aboutsummaryrefslogtreecommitdiff
path: root/src/memory_allocator.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-05 11:35:50 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-05 11:35:50 -0800
commit320c23543c180d7cd9bfa3218386c890584fa65b (patch)
tree8a5d477ec75c94047e4b98e3718a6f26a4bc92f4 /src/memory_allocator.zig
parent0ea8de40871052842f2e342b4c452f6746691487 (diff)
downloadbun-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.zig4
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 {