zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ad4b591db1155d52bfce526c695594cc2dda7f14 (tree)
parent 64c149ca19cc299485693acbda325eee51d37f28
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 20 May 2020 16:30:28 -0400

small bump to ArenaAllocator minimum alloc size

self-hosted parser benchmark:
throughput: 69.4 MiB/s => 72.2 MiB/s

Diffstat:
Mlib/std/heap/arena_allocator.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/heap/arena_allocator.zig b/lib/std/heap/arena_allocator.zig @@ -46,7 +46,7 @@ pub const ArenaAllocator = struct { } fn createNode(self: *ArenaAllocator, prev_len: usize, minimum_size: usize) !*BufNode { - const actual_min_size = minimum_size + @sizeOf(BufNode); + const actual_min_size = minimum_size + (@sizeOf(BufNode) + 16); const big_enough_len = prev_len + actual_min_size; const len = big_enough_len + big_enough_len / 2; const buf = try self.child_allocator.alignedAlloc(u8, @alignOf(BufNode), len);