diff options
author | 2022-12-05 11:35:50 -0800 | |
---|---|---|
committer | 2022-12-05 11:35:50 -0800 | |
commit | 320c23543c180d7cd9bfa3218386c890584fa65b (patch) | |
tree | 8a5d477ec75c94047e4b98e3718a6f26a4bc92f4 /src/memory_allocator.zig | |
parent | 0ea8de40871052842f2e342b4c452f6746691487 (diff) | |
download | bun-320c23543c180d7cd9bfa3218386c890584fa65b.tar.gz bun-320c23543c180d7cd9bfa3218386c890584fa65b.tar.zst bun-320c23543c180d7cd9bfa3218386c890584fa65b.zip |
Fix alignment edgecase
Diffstat (limited to 'src/memory_allocator.zig')
-rw-r--r-- | src/memory_allocator.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/memory_allocator.zig b/src/memory_allocator.zig index 9918c9c45..a4f79cd16 100644 --- a/src/memory_allocator.zig +++ b/src/memory_allocator.zig @@ -39,7 +39,7 @@ const CAllocator = struct { const MI_MAX_ALIGN_SIZE = 16; inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool { return (alignment == @sizeOf(*anyopaque) or - (alignment == MI_MAX_ALIGN_SIZE and size > (MI_MAX_ALIGN_SIZE / 2))); + (alignment == MI_MAX_ALIGN_SIZE and size >= (MI_MAX_ALIGN_SIZE / 2))); } fn alignedAlloc(len: usize, alignment: usize) ?[*]u8 { @@ -136,7 +136,7 @@ const ZAllocator = struct { const MI_MAX_ALIGN_SIZE = 16; inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool { return (alignment == @sizeOf(*anyopaque) or - (alignment == MI_MAX_ALIGN_SIZE and size > (MI_MAX_ALIGN_SIZE / 2))); + (alignment == MI_MAX_ALIGN_SIZE and size >= (MI_MAX_ALIGN_SIZE / 2))); } fn alignedAlloc(len: usize, alignment: usize) ?[*]u8 { |