From 72d997ac2f4629281fc5299305fd370b69f2eeb3 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Thu, 24 Sep 2026 10:05:24 +0200 Subject: Meta Alloc tweaks. --- MetaAlloc.ods | Bin 35279 -> 35370 bytes src/zisp/gc/meta_alloc.zig | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MetaAlloc.ods b/MetaAlloc.ods index 1313aab..8d0eb95 100644 Binary files a/MetaAlloc.ods and b/MetaAlloc.ods differ diff --git a/src/zisp/gc/meta_alloc.zig b/src/zisp/gc/meta_alloc.zig index 248b00b..726dda4 100644 --- a/src/zisp/gc/meta_alloc.zig +++ b/src/zisp/gc/meta_alloc.zig @@ -41,7 +41,7 @@ // next_head_idx: u32, // extra_idx_count: u32, // pad_to_64_bytes: [14]u32, -// extra_idx_array: [16]u32, +// extra_idx_array: [32]u32, // } // // So, it's not a typical free-list where each node simply points to the next @@ -106,7 +106,7 @@ const SlotPtr = [*]Unit; const SIZES: [16]usize = .{ // Important: Ensure the smallest size class is inherently immune to false // sharing, and no smaller than: 64 + @sizeOf(UnitIdx) * ( FSC_MAX / 2 ). - // That's exactly 128 bytes assuming FSC_MAX = 32 (see below). + // That's 192 bytes assuming FSC_MAX = 64 (see below). 256, 512, 1024, @@ -164,11 +164,11 @@ var slab_infos: [SIZES.len]SlabInfo = @splat(.{}); /// Maximum number of slots reserved by a thread when bumping a slab watermark. /// Halved after every two size classes, so make sure it's >= 128. -const RESERVE_MAX: UnitIdx = 512; // Results in 4 for the two largest classes. +const RESERVE_MAX: UnitIdx = 1024; // Results in 8 for the two largest classes. /// Maximum number of free slot cache entries before half of them are flushed. /// Halved after every four size classes, so make sure it's >= 8. -const FSC_MAX: UnitIdx = 32; // Results in 4 for the two largest classes. +const FSC_MAX: UnitIdx = 64; // Results in 8 for the two largest classes. /// Given a size class index 0 to 15, returns the number of slots that a thread /// should reserve every time it needs to bump the global watermark. Starts at -- cgit v1.2.3