Fix static init ordering issue with the runtime build

This commit is contained in:
rdb 2012-02-10 09:19:12 +00:00
parent 61fa1e4c26
commit d290a193ad

View File

@ -25,10 +25,6 @@ static const size_t min_page_remaining_size = 16;
// We always allocate at least this many bytes at a time.
static const size_t min_page_size = 128 * 1024; // 128K
// We always allocate integer multiples of this many bytes, to
// guarantee this minimum alignment.
static const size_t alignment_size = MemoryHook::get_memory_alignment();
////////////////////////////////////////////////////////////////////
// Function: NeverFreeMemory::Constructor
// Access: Private
@ -49,6 +45,10 @@ void *NeverFreeMemory::
ns_alloc(size_t size) {
_lock.acquire();
// We always allocate integer multiples of this many bytes, to
// guarantee this minimum alignment.
static const size_t alignment_size = MemoryHook::get_memory_alignment();
// Round up to the next alignment_size.
size = ((size + alignment_size - 1) / alignment_size) * alignment_size;