add std.heap.SmpAllocator

An allocator intended to be used in -OReleaseFast mode when
multi-threading is enabled.
This commit is contained in:
Andrew Kelley
2025-02-06 03:31:32 -08:00
parent 6a6e72fff8
commit 51c4ffa410
5 changed files with 317 additions and 20 deletions

View File

@@ -851,8 +851,6 @@ pub fn DebugAllocator(comptime config: Config) type {
self.mutex.lock();
defer self.mutex.unlock();
assert(old_memory.len != 0);
const size_class_index: usize = @max(@bitSizeOf(usize) - @clz(old_memory.len - 1), @intFromEnum(alignment));
if (size_class_index >= self.buckets.len) {
@branchHint(.unlikely);