fn GeneralPurposeAllocator(comptime config: Config) type

Parameters

config: Config,

Fields

backing_allocator: Allocator = std.heap.page_allocator,
buckets: [small_bucket_count]?*BucketHeader = array_mul,
large_allocations: LargeAllocTable = .{ },
small_allocations: if (config.safety) SmallAllocTable else void = if (config.safety) .{} else {},
empty_buckets: if (config.retain_metadata) ?*BucketHeader else void = if (config.retain_metadata) null else {},
total_requested_bytes: @TypeOf(total_requested_bytes_init) = total_requested_bytes_init,
requested_memory_limit: @TypeOf(requested_memory_limit_init) = requested_memory_limit_init,
mutex: @TypeOf(mutex_init) = mutex_init,

Functions

fn allocator(self: *Self) Allocator

No documentation provided.

fn deinit(self: *Self) Check

Returns Check.leak if there were leaks; Check.ok otherwise.

fn detectLeaks(self: *Self) bool

Emits log messages for leaks and then returns whether there were any leaks.

fn setRequestedMemoryLimit(self: *Self, limit: usize) void

No documentation provided.

Error Sets