summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-09-07 11:00:12 -0500
committerDave Parks <davep@lindenlab.com>2012-09-07 11:00:12 -0500
commit1b89f373c2ec3871585b88670d530f7c253a0bce (patch)
treeb9cc0134a80916ee22eb9f7a90bdd59d4e8d05ca /indra/llcommon
parentb1b135cfaefa1ae371a03819943963d2b00c00aa (diff)
parent980d5a75556f802e412d24b14a48a49c76126e19 (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-cat
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llmemory.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index 6a2323e7d8..36d2d9da37 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -61,14 +61,18 @@ inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed wi
#endif
}
-inline void* ll_aligned_realloc_16(void* ptr, size_t size) // returned hunk MUST be freed with ll_aligned_free_16().
+inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // returned hunk MUST be freed with ll_aligned_free_16().
{
#if defined(LL_WINDOWS)
return _aligned_realloc(ptr, size, 16);
#elif defined(LL_DARWIN)
return realloc(ptr,size); // default osx malloc is 16 byte aligned.
#else
- return realloc(ptr,size); // FIXME not guaranteed to be aligned.
+ //FIXME: memcpy is SLOW
+ void* ret = ll_aligned_malloc_16(size);
+ memcpy(ret, ptr, old_size);
+ ll_aligned_free_16(ptr);
+ return ret;
#endif
}