From bdb1b7124aec3ca42a13dd13309df4c8e4e3cc64 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 13 Jun 2023 09:15:05 -0700 Subject: Fix crash in CJS (#3294) * Fix crash in CJS * Add std.heap.ArenaAllocator * Use our arena allocator * Reduce JS parser memory usage and make HMR faster * Write some comments * fix test failure & clean up this code * Update javascript.zig * make arena usage safer --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/webcore/blob.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bun.js/webcore/blob.zig') diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index 13b086541..9b3ddb8df 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -242,7 +242,7 @@ pub const Blob = struct { allocator: std.mem.Allocator, form_data: *JSC.DOMFormData, ) Blob { - var arena = std.heap.ArenaAllocator.init(allocator); + var arena = @import("root").bun.ArenaAllocator.init(allocator); defer arena.deinit(); var stack_allocator = std.heap.stackFallback(1024, arena.allocator()); var stack_mem_all = stack_allocator.get(); -- cgit v1.2.3