diff options
author | Tim Rowley <[email protected]> | 2016-05-06 12:49:23 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-05-19 16:26:38 -0500 |
commit | 4997169779069692c0e64df2dfb89185ae48f193 (patch) | |
tree | 6e12a46c3cd5b04b1901aa5ae4577b68f05dba00 /src/gallium/drivers/swr/rasterizer/common | |
parent | 2e4ef235231dbaee0c331f35c69a85404507ac1e (diff) |
swr: [rasterizer] rename _aligned_malloc to AlignedMalloc
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/os.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h index 1d685851219..8b156702ba0 100644 --- a/src/gallium/drivers/swr/rasterizer/common/os.h +++ b/src/gallium/drivers/swr/rasterizer/common/os.h @@ -49,6 +49,16 @@ #define PRAGMA_WARNING_POP() __pragma(warning(pop)) +static inline void *AlignedMalloc(size_t _Size, size_t _Alignment) +{ + return _aligned_malloc(_Size, _Alignment); +} + +static inline void AlignedFree(void* p) +{ + return _aligned_free(p); +} + #if defined(_WIN64) #define BitScanReverseSizeT BitScanReverse64 #define BitScanForwardSizeT BitScanForward64 @@ -155,7 +165,7 @@ unsigned char _BitScanReverse(unsigned int *Index, unsigned int Mask) } inline -void *_aligned_malloc(unsigned int size, unsigned int alignment) +void *AlignedMalloc(unsigned int size, unsigned int alignment) { void *ret; if (posix_memalign(&ret, alignment, size)) @@ -171,12 +181,17 @@ unsigned char _bittest(const LONG *a, LONG b) return ((*(unsigned *)(a) & (1 << b)) != 0); } +static inline +void AlignedFree(void* p) +{ + free(p); +} + #define GetCurrentProcessId getpid #define GetCurrentThreadId gettid #define CreateDirectory(name, pSecurity) mkdir(name, 0777) -#define _aligned_free free #define InterlockedCompareExchange(Dest, Exchange, Comparand) __sync_val_compare_and_swap(Dest, Comparand, Exchange) #define InterlockedExchangeAdd(Addend, Value) __sync_fetch_and_add(Addend, Value) #define InterlockedDecrement(Append) __sync_sub_and_fetch(Append, 1) |