summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-03-04 18:06:29 -0600
committerDave Parks <davep@lindenlab.com>2013-03-04 18:06:29 -0600
commit586025bde53ffcd160a9d169cca328ed5078f5f4 (patch)
tree1f59d27d08567fd5f3fe02ce42fe6bae37bd3b2c /indra/llcommon
parent3ee3c3ced32bd1e67a6bea51341734c8764df018 (diff)
parent609ed855e1160505238378a1be49e2b92e8496f5 (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-cat
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llmemory.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index e725bdd9fa..46cabfadcd 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -38,17 +38,28 @@ class LLMutex ;
inline void* ll_aligned_malloc( size_t size, int align )
{
+#if defined(LL_WINDOWS)
+ return _aligned_malloc(size, align);
+#else
void* mem = malloc( size + (align - 1) + sizeof(void*) );
char* aligned = ((char*)mem) + sizeof(void*);
aligned += align - ((uintptr_t)aligned & (align - 1));
((void**)aligned)[-1] = mem;
return aligned;
+#endif
}
inline void ll_aligned_free( void* ptr )
{
- free( ((void**)ptr)[-1] );
+#if defined(LL_WINDOWS)
+ _aligned_free(ptr);
+#else
+ if (ptr)
+ {
+ free( ((void**)ptr)[-1] );
+ }
+#endif
}
#if !LL_USE_TCMALLOC