aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-01 04:47:47 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-16 19:18:51 -0800
commitb0600564802db8c76da9773699d908b97988db40 (patch)
treed91e3dbde0bfdeff5a993af4b6ab36b613541588
parentb71df3a3d47b3e1d471423570ae610fbdf09f8e5 (diff)
downloadbun-b0600564802db8c76da9773699d908b97988db40.tar.gz
bun-b0600564802db8c76da9773699d908b97988db40.tar.zst
bun-b0600564802db8c76da9773699d908b97988db40.zip
Update memory_allocator.zig
-rw-r--r--src/memory_allocator.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/memory_allocator.zig b/src/memory_allocator.zig
index bc15c55bf..9f6642bd5 100644
--- a/src/memory_allocator.zig
+++ b/src/memory_allocator.zig
@@ -24,10 +24,9 @@ const CAllocator = struct {
if (supports_posix_memalign) {
// The posix_memalign only accepts alignment values that are a
// multiple of the pointer size
- const eff_alignment = std.math.max(alignment, @sizeOf(usize));
var aligned_ptr: ?*c_void = undefined;
- if (mimalloc.mi_posix_memalign(&aligned_ptr, eff_alignment, len) != 0)
+ if (mimalloc.mi_posix_memalign(&aligned_ptr, @maximum(alignment, @sizeOf(usize)), len) != 0)
return null;
return @ptrCast([*]u8, aligned_ptr);