Skip to content

Commit

Permalink
fix: only panic on ref count underflows in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jan 8, 2025
1 parent 76da0e2 commit 1e0954b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/allocators/linux_memfd_allocator.zig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ pub const LinuxMemFdAllocator = struct {
},
0 => {
// TODO: @branchHint(.cold) after Zig 0.14 upgrade
std.debug.panic("LinuxMemFdAllocator ref_count underflow", .{});
if (comptime bun.Environment.isDebug) {
std.debug.panic("LinuxMemFdAllocator ref_count underflow", .{});
}
},
else => {},
}
Expand Down

0 comments on commit 1e0954b

Please sign in to comment.