mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
Fix bug causing GC to sometimes never run
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <JavaScriptCore/BytecodeIndex.h>
|
||||
#include <JavaScriptCore/CodeBlock.h>
|
||||
#include <JavaScriptCore/Completion.h>
|
||||
#include <JavaScriptCore/DeferredWorkTimer.h>
|
||||
#include <JavaScriptCore/ErrorInstance.h>
|
||||
#include <JavaScriptCore/ExceptionHelpers.h>
|
||||
#include <JavaScriptCore/ExceptionScope.h>
|
||||
@@ -740,7 +741,7 @@ JSC__JSValue ZigString__to16BitValue(const ZigString* arg0, JSC__JSGlobalObject*
|
||||
return JSC::JSValue::encode(JSC::JSValue(JSC::jsString(arg1->vm(), str)));
|
||||
}
|
||||
|
||||
void free_global_string(void* str, void* ptr, unsigned len)
|
||||
static void free_global_string(void* str, void* ptr, unsigned len)
|
||||
{
|
||||
ZigString__free_global(reinterpret_cast<const unsigned char*>(ptr), len);
|
||||
}
|
||||
@@ -2179,6 +2180,11 @@ void JSC__VM__deferGC(JSC__VM* vm, void* ctx, void (*callback)(void* arg0))
|
||||
callback(ctx);
|
||||
}
|
||||
|
||||
void JSC__VM__doWork(JSC__VM* vm)
|
||||
{
|
||||
vm->deferredWorkTimer->runRunLoop();
|
||||
}
|
||||
|
||||
void JSC__VM__deleteAllCode(JSC__VM* arg1, JSC__JSGlobalObject* globalObject)
|
||||
{
|
||||
JSC::JSLockHolder locker(globalObject->vm());
|
||||
|
||||
@@ -2502,7 +2502,14 @@ pub const VM = extern struct {
|
||||
});
|
||||
}
|
||||
|
||||
pub const Extern = [_][]const u8{ "deferGC", "holdAPILock", "runGC", "generateHeapSnapshot", "isJITEnabled", "deleteAllCode", "create", "deinit", "setExecutionForbidden", "executionForbidden", "isEntered", "throwError", "drainMicrotasks", "whenIdle", "shrinkFootprint", "setExecutionTimeLimit", "clearExecutionTimeLimit" };
|
||||
pub fn doWork(
|
||||
vm: *VM,
|
||||
) void {
|
||||
return cppFn("doWork", .{
|
||||
vm,
|
||||
});
|
||||
}
|
||||
pub const Extern = [_][]const u8{ "doWork", "deferGC", "holdAPILock", "runGC", "generateHeapSnapshot", "isJITEnabled", "deleteAllCode", "create", "deinit", "setExecutionForbidden", "executionForbidden", "isEntered", "throwError", "drainMicrotasks", "whenIdle", "shrinkFootprint", "setExecutionTimeLimit", "clearExecutionTimeLimit" };
|
||||
};
|
||||
|
||||
pub const ThrowScope = extern struct {
|
||||
|
||||
Reference in New Issue
Block a user