]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
JIT: Don't call uae_vm_free in LazyBlockAllocator destructor
authorFrode Solheim <frode@fs-uae.net>
Sat, 19 Sep 2015 09:37:17 +0000 (11:37 +0200)
committerFrode Solheim <frode@fs-uae.net>
Sat, 19 Sep 2015 09:37:17 +0000 (11:37 +0200)
jit/compemu_support.cpp

index d0b8c0ef9de97c85afaa32eff98be3316370cc9b..984f3a9a56c23714da41d59a4964c766d6178dce 100644 (file)
@@ -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<T>::~LazyBlockAllocator()
 {
@@ -741,6 +750,7 @@ LazyBlockAllocator<T>::~LazyBlockAllocator()
                vm_release(deadPool, sizeof(Pool));
        }
 }
+#endif
 
 template< class T >
 T * LazyBlockAllocator<T>::acquire()