From: Frode Solheim Date: Sat, 19 Sep 2015 09:37:17 +0000 (+0200) Subject: JIT: Don't call uae_vm_free in LazyBlockAllocator destructor X-Git-Tag: 3200~61^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=187c0adaaec10a85b315fb12cb0251ddc5a56db2;p=francis%2Fwinuae.git JIT: Don't call uae_vm_free in LazyBlockAllocator destructor --- diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index d0b8c0ef..984f3a9a 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -726,11 +726,20 @@ class LazyBlockAllocator T * mChunks; public: LazyBlockAllocator() : mPools(0), mChunks(0) { } +#ifdef UAE +#else ~LazyBlockAllocator(); +#endif T * acquire(); void release(T * const); }; +#ifdef UAE +/* uae_vm_release may do logging, which isn't safe to do when the application + * is shutting down. Better to release memory manually with a function call + * to a release_all method on shutdown, or even simpler, just let the OS + * handle it (we're shutting down anyway). */ +#else template< class T > LazyBlockAllocator::~LazyBlockAllocator() { @@ -741,6 +750,7 @@ LazyBlockAllocator::~LazyBlockAllocator() vm_release(deadPool, sizeof(Pool)); } } +#endif template< class T > T * LazyBlockAllocator::acquire()