We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 861c969 commit 9b0d735Copy full SHA for 9b0d735
src/zemscripten.zig
@@ -111,9 +111,8 @@ pub const EmmallocAllocator = struct {
111
) ?[*]u8 {
112
_ = ctx;
113
_ = return_address;
114
- const ptr_align: u32 = @as(u32, 1) << @intCast(@intFromEnum(ptr_align_log2));
115
- if (!std.math.isPowerOfTwo(ptr_align)) unreachable;
116
- const ptr = emmalloc_memalign(ptr_align, @intCast(len)) orelse return null;
+ const ptr_align = ptr_align_log2.toByteUnits();
+ const ptr = emmalloc_memalign(@intCast(ptr_align), @intCast(len)) orelse return null;
117
return @ptrCast(ptr);
118
}
119
0 commit comments