-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: consolidate allocators #16061
base: main
Are you sure you want to change the base?
Conversation
Updated 7:16 PM PT - Jan 1st, 2025
❌ @DonIsaac, your commit aa02a42 has 1 failures in
🧪 try this PR locally: bunx bun-pr 16061 |
… don/refactor/allocators
}, | ||
0 => { | ||
// TODO: @branchHint(.cold) after Zig 0.14 upgrade | ||
std.debug.panic("LinuxMemFdAllocator ref_count underflow", .{}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's throw this in a if (Environment.isDebug) {... }
block. I'm not familiar with how/where this allocator is dereferenced, but we don't want to introduce a panic for something that could be a noop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment
What does this PR do?
Moves all memory allocators into
src/allocators
. The following allocators are affected:NullableAllocator
MimallocArena
MaxHeapAllocator
LinuxMemFdAllocator
memory_allocator.zig
(CAllocator
,ZAllocator
,HugeAllocator
, etc)I also added an underflow check to
LinuxMemFdAllocator
in case a consumer callsderef()
without first callingref()