switching to smp_allocator
All checks were successful
Build / build (push) Successful in 2m5s
Test / build_and_test (push) Successful in 1h14m49s

This commit is contained in:
2026-04-04 03:59:54 +02:00
parent c0e71d501a
commit 6f6f2e6ab2
6 changed files with 86 additions and 23 deletions

View File

@@ -9,16 +9,22 @@ const Alignment = std.mem.Alignment;
const Self = @This();
const FallbackAllocator = struct {
pub inline fn allocator(_: @This()) std.mem.Allocator {
return std.heap.smp_allocator;
}
};
callbacks: ?vk.AllocationCallbacks,
scope: vk.SystemAllocationScope,
fallback_allocator: std.heap.ThreadSafeAllocator,
fallback_allocator: FallbackAllocator,
pub fn init(callbacks: ?*const vk.AllocationCallbacks, scope: vk.SystemAllocationScope) Self {
const deref_callbacks = if (callbacks) |c| c.* else null;
return .{
.callbacks = deref_callbacks,
.scope = scope,
.fallback_allocator = .{ .child_allocator = std.heap.c_allocator },
.fallback_allocator = .{},
};
}