aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-01 18:40:41 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-01 18:40:41 -0800
commit03490afdb37eebe6c215b4a17944243cdf44f204 (patch)
tree6d6270daedac5a0acf3b2366fac241e7904c7e37 /src
parente1e5f8c43b10761bd8f2d426f87bd0506a9feedb (diff)
downloadbun-03490afdb37eebe6c215b4a17944243cdf44f204.tar.gz
bun-03490afdb37eebe6c215b4a17944243cdf44f204.tar.zst
bun-03490afdb37eebe6c215b4a17944243cdf44f204.zip
Fix crash in test runner with gc mode
Diffstat (limited to 'src')
-rw-r--r--src/bun.zig1
-rw-r--r--src/cli/test_command.zig4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bun.zig b/src/bun.zig
index 6443c6923..a615cd62a 100644
--- a/src/bun.zig
+++ b/src/bun.zig
@@ -498,3 +498,4 @@ pub const analytics = @import("./analytics.zig");
pub const DateTime = @import("./deps/zig-datetime/src/datetime.zig");
pub var start_time: i128 = 0;
+pub const MimallocArena = @import("./mimalloc_arena.zig").Arena;
diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig
index a8e028d75..48e27011a 100644
--- a/src/cli/test_command.zig
+++ b/src/cli/test_command.zig
@@ -451,8 +451,10 @@ pub const TestCommand = struct {
}
};
+ var arena = bun.MimallocArena.init() catch @panic("Unexpected error in mimalloc");
vm_.eventLoop().ensureWaker();
-
+ vm_.arena = &arena;
+ vm_.allocator = arena.allocator();
var ctx = Context{ .reporter = reporter_, .vm = vm_, .files = files_, .allocator = allocator_ };
vm_.runWithAPILock(Context, &ctx, Context.begin);
}