mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
Fix static init ordering issue with the runtime build
This commit is contained in:
parent
61fa1e4c26
commit
d290a193ad
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user