diff options
author | Dave Parks <davep@lindenlab.com> | 2010-12-03 03:28:39 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-12-03 03:28:39 -0600 |
commit | a74299b76b25b847bf3d36791dd961a7a463ba05 (patch) | |
tree | 8d8c9690600f9cb47c27a10a74397b529acca485 /indra/llcommon | |
parent | 48b107ac97a3de61ba028c6058fc1c848309e60f (diff) | |
parent | 71f4d880082df829aff56898af138d3f3f2c962a (diff) |
Automated merge with https://hg.secondlife.com/mesh-development
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llmemory.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 985f5ca30f..8d114f744b 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -1,25 +1,25 @@ -/** +/** * @file llmemory.h * @brief Memory allocation/deallocation header-stuff goes here. * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -29,12 +29,13 @@ #include <stdlib.h> // A not necessarily efficient, but general, aligned malloc http://stackoverflow.com/questions/196329/osx-lacks-memalign +#if 0 //DON'T use ll_aligned_foo now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals) inline void* ll_aligned_malloc( size_t size, int align ) { 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; } @@ -95,6 +96,7 @@ inline void ll_aligned_free_32(void *p) free(p); // posix_memalign() is compatible with heap deallocator #endif } +#endif class LL_COMMON_API LLMemory { |