mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
Add alignment feature flag
This commit is contained in:
@@ -79,6 +79,10 @@ const CAllocator = struct {
|
||||
}
|
||||
|
||||
fn alloc(_: *anyopaque, len: usize, log2_align: u8, _: usize) ?[*]u8 {
|
||||
if (comptime FeatureFlags.alignment_tweak) {
|
||||
return alignedAlloc(len, log2_align);
|
||||
}
|
||||
|
||||
const alignment = @as(usize, 1) << @intCast(Allocator.Log2Align, log2_align);
|
||||
return alignedAlloc(len, alignment);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user