summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmemory.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-01-09 23:05:07 -0800
committerRichard Linden <none@none>2013-01-09 23:05:07 -0800
commit1a888f786c274ee6eaed54272718eeef5e685dbf (patch)
tree175e80be3d347b3f7ee053d51ee8daef8abcde36 /indra/llcommon/llmemory.h
parent386e918583fe25532f401c6b50c49632d7410d39 (diff)
SH-3468 WIP add memory tracking base class
made LLTrace::MemTrackable support custom alignment LLDrawable now uses MemTrackable new and delete operators
Diffstat (limited to 'indra/llcommon/llmemory.h')
-rw-r--r--indra/llcommon/llmemory.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index 4ead45679f..95500753e4 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -39,6 +39,20 @@ class LLMutex ;
#define LL_CHECK_MEMORY
#endif
+#if LL_WINDOWS
+#define LL_ALIGN_OF __alignof
+#else
+#define LL_ALIGN_OF __align_of__
+#endif
+
+#if LL_WINDOWS
+#define LL_DEFAULT_HEAP_ALIGN 8
+#elif LL_DARWIN
+#define LL_DEFAULT_HEAP_ALIGN 16
+#elif LL_LINUX
+#define LL_DEFAULT_HEAP_ALIGN 8
+#endif
+
inline void* ll_aligned_malloc( size_t size, int align )
{
void* mem = malloc( size + (align - 1) + sizeof(void*) );