diff options
author | 2012-01-26 20:35:51 +0000 | |
---|---|---|
committer | 2012-01-26 20:35:51 +0000 | |
commit | eb79c00418108690670219fc1e2231c6bab5b9d4 (patch) | |
tree | 9c9f8092ffca04af622bb4ddfcd20bdee1da460e /src/emu/emualloc.c | |
parent | bc6f400f2721379f29cfaec57ef5b7d5ddff2b52 (diff) |
Wrapped the global_resource_pool into a function in an attempt to
ensure it is initialized before anyone that references it.
Diffstat (limited to 'src/emu/emualloc.c')
-rw-r--r-- | src/emu/emualloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/emu/emualloc.c b/src/emu/emualloc.c index a091add4b67..c46b64e89e6 100644 --- a/src/emu/emualloc.c +++ b/src/emu/emualloc.c @@ -112,9 +112,6 @@ private: // GLOBALS //************************************************************************** -// global resource pool to handle allocations outside of the emulator context -resource_pool global_resource_pool(6151); - // dummy zeromem object const zeromem_t zeromem = { }; @@ -126,6 +123,12 @@ bool memory_entry::s_tracking = false; memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL }; memory_entry *memory_entry::s_freehead = NULL; +// wrapper for the global resource pool to help ensure construction order +resource_pool &global_resource_pool() +{ + static resource_pool s_pool(6151); + return s_pool; +}; //************************************************************************** |