aboutsummaryrefslogtreecommitdiff
path: root/src/bun_js.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun_js.zig')
-rw-r--r--src/bun_js.zig27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/bun_js.zig b/src/bun_js.zig
index 6bbf093ae..d02b4abe4 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -30,7 +30,7 @@ const DotEnv = @import("env_loader.zig");
const which = @import("which.zig").which;
const JSC = @import("root").bun.JSC;
const AsyncHTTP = @import("root").bun.HTTP.AsyncHTTP;
-const Arena = @import("./mimalloc_arena.zig").Arena;
+// const Arena = @import("./mimalloc_arena.zig").Arena;
const OpaqueWrap = JSC.OpaqueWrap;
const VirtualMachine = JSC.VirtualMachine;
@@ -40,7 +40,7 @@ pub const Run = struct {
ctx: Command.Context,
vm: *VirtualMachine,
entry_path: string,
- arena: Arena = undefined,
+ // arena: Arena = undefined,
any_unhandled: bool = false,
pub fn bootStandalone(ctx_: Command.Context, entry_path: string, graph: bun.StandaloneModuleGraph) !void {
@@ -53,15 +53,15 @@ pub const Run = struct {
js_ast.Expr.Data.Store.create(default_allocator);
js_ast.Stmt.Data.Store.create(default_allocator);
- var arena = try Arena.init();
+ // var arena = try Arena.init();
if (!ctx.debug.loaded_bunfig) {
try bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", &ctx, .RunCommand);
}
run = .{
- .vm = try VirtualMachine.initWithModuleGraph(arena.allocator(), ctx.log, graph_ptr),
- .arena = arena,
+ .vm = try VirtualMachine.initWithModuleGraph(bun.default_allocator, ctx.log, graph_ptr),
+ // .arena = arena,
.ctx = ctx,
.entry_path = entry_path,
};
@@ -70,8 +70,8 @@ pub const Run = struct {
var b = &vm.bundler;
vm.preload = ctx.preloads;
vm.argv = ctx.passthrough;
- vm.arena = &run.arena;
- vm.allocator = arena.allocator();
+ // vm.arena = &run.arena;
+ vm.allocator = bun.default_allocator;
b.options.install = ctx.install;
b.resolver.opts.install = ctx.install;
@@ -136,7 +136,7 @@ pub const Run = struct {
js_ast.Expr.Data.Store.create(default_allocator);
js_ast.Stmt.Data.Store.create(default_allocator);
- var arena = try Arena.init();
+ // var arena = try Arena.init();
if (!ctx.debug.loaded_bunfig) {
try bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", &ctx, .RunCommand);
@@ -144,7 +144,7 @@ pub const Run = struct {
run = .{
.vm = try VirtualMachine.init(
- arena.allocator(),
+ bun.default_allocator,
ctx.args,
null,
ctx.log,
@@ -152,7 +152,7 @@ pub const Run = struct {
ctx.debug.hot_reload != .none,
ctx.runtime_options.smol,
),
- .arena = arena,
+ // .arena = arena,
.ctx = ctx,
.entry_path = entry_path,
};
@@ -161,8 +161,8 @@ pub const Run = struct {
var b = &vm.bundler;
vm.preload = ctx.preloads;
vm.argv = ctx.passthrough;
- vm.arena = &run.arena;
- vm.allocator = arena.allocator();
+ // vm.arena = &run.arena;
+ vm.allocator = bun.default_allocator;
b.options.install = ctx.install;
b.resolver.opts.install = ctx.install;
@@ -298,7 +298,8 @@ pub const Run = struct {
vm.eventLoop().tickConcurrentWithCount() > 0)
{
vm.global.vm().releaseWeakRefs();
- _ = vm.arena.gc(false);
+ // _ = vm.arena.gc(false);
+ Global.mimalloc_cleanup(false);
_ = vm.global.vm().runGC(false);
vm.tick();
}