aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/api')
-rw-r--r--src/bun.js/api/bun.zig6
-rw-r--r--src/bun.js/api/server.zig2
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,