mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
Free more memory in destructOnExit and add assertion
This commit is contained in:
@@ -210,6 +210,8 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "mimalloc.h"
|
||||
|
||||
using namespace Bun;
|
||||
|
||||
BUN_DECLARE_HOST_FUNCTION(Bun__NodeUtil__jsParseArgs);
|
||||
@@ -4665,7 +4667,10 @@ extern "C" void Zig__GlobalObject__destructOnExit(Zig::GlobalObject* globalObjec
|
||||
globalObject = nullptr;
|
||||
vm.heap.collectNow(JSC::Sync, JSC::CollectionScope::Full);
|
||||
vm.derefSuppressingSaferCPPChecking();
|
||||
ASSERT_WITH_MESSAGE(vm.hasOneRef(), "JSC::VM has more than one ref. destructOnExit will not work.");
|
||||
vm.derefSuppressingSaferCPPChecking();
|
||||
WTF::releaseFastMallocFreeMemory();
|
||||
mi_collect(false);
|
||||
}
|
||||
|
||||
#include "ZigGeneratedClasses+lazyStructureImpl.h"
|
||||
|
||||
Reference in New Issue
Block a user