diff options
author | 2022-11-19 04:56:46 -0800 | |
---|---|---|
committer | 2022-11-19 04:56:46 -0800 | |
commit | bb95f90a62f3bbccd63288876870d1b107f510c3 (patch) | |
tree | 8e1db00ae697a69db516f8ed618778ce42c7130f /src/bun.js/api | |
parent | 180632255488cf89009b2549951102340cd4997c (diff) | |
download | bun-bb95f90a62f3bbccd63288876870d1b107f510c3.tar.gz bun-bb95f90a62f3bbccd63288876870d1b107f510c3.tar.zst bun-bb95f90a62f3bbccd63288876870d1b107f510c3.zip |
Introduce `BUN_GARBAGE_COLLECTOR_LEVEL` debug environment variable
Diffstat (limited to 'src/bun.js/api')
-rw-r--r-- | src/bun.js/api/bun.zig | 6 | ||||
-rw-r--r-- | src/bun.js/api/server.zig | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 49143ec5c..131e08b6e 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -894,11 +894,7 @@ pub fn runGC( arguments: []const js.JSValueRef, _: js.ExceptionRef, ) js.JSValueRef { - // it should only force cleanup on thread exit - - Global.mimalloc_cleanup(false); - - return ctx.ptr().vm().runGC(arguments.len > 0 and JSValue.fromRef(arguments[0]).toBoolean()).asRef(); + return ctx.bunVM().garbageCollect(arguments.len > 0 and JSC.JSValue.c(arguments[0]).toBoolean()).asObjectRef(); } pub fn shrink( diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 866b08e34..92a3c23d0 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -4490,7 +4490,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type { this.config.hostname; this.ref(); - + this.vm.autoGarbageCollect(); this.app.listenWithConfig(*ThisServer, this, onListen, .{ .port = this.config.port, .host = host, |