diff options
author | brad kittenbrink <brad@lindenlab.com> | 2011-05-12 16:09:42 -0700 |
---|---|---|
committer | brad kittenbrink <brad@lindenlab.com> | 2011-05-12 16:09:42 -0700 |
commit | 2a843e9a6bb5cb70f69794419ab4a7d16ee3c6cb (patch) | |
tree | b9ab49342513f0f3fc80c58df7657c92f67f1bc2 /indra/llcommon/llmemory.h | |
parent | b3dddbf30b42eff8ef7031c63e91244f07e8bd77 (diff) |
Fix up alignment problems for debug build.
reviewed by davep.
Diffstat (limited to 'indra/llcommon/llmemory.h')
-rw-r--r-- | indra/llcommon/llmemory.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 0adb78236e..3bd1403576 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -28,7 +28,7 @@ #include "llmemtype.h" -#if 0 //DON'T use ll_aligned_foo now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals) +#if LL_DEBUG inline void* ll_aligned_malloc( size_t size, int align ) { void* mem = malloc( size + (align - 1) + sizeof(void*) ); @@ -95,7 +95,15 @@ inline void ll_aligned_free_32(void *p) free(p); // posix_memalign() is compatible with heap deallocator #endif } -#endif +#else // LL_DEBUG +// ll_aligned_foo are noops now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals) +#define ll_aligned_malloc( size, align ) malloc(size) +#define ll_aligned_free( ptr ) free(ptr) +#define ll_aligned_malloc_16 malloc +#define ll_aligned_free_16 free +#define ll_aligned_malloc_32 malloc +#define ll_aligned_free_32 free +#endif // LL_DEBUG class LL_COMMON_API LLMemory { |