Pool module

set_allocators

procedure · 1 overloadSource

Chooses the allocator the pool takes its blocks from: block_allocator if given, else context.allocator.

The first get calls it when nothing was chosen. Calling it again once an allocator is set logs an error and changes nothing. With the module parameter USE_UNMAPPING_ALLOCATOR the default is the unmapping allocator and free_memblocks_on_reset is turned on.

set_allocators :: (pool: *Pool, block_allocator: Allocator = .{})

Chooses the allocator the pool takes its blocks from: block_allocator if given, else context.allocator.

The first get calls it when nothing was chosen. Calling it again once an allocator is set logs an error and changes nothing. With the module parameter USE_UNMAPPING_ALLOCATOR the default is the unmapping allocator and free_memblocks_on_reset is turned on.

Parameters

pool: *Pool
block_allocator: Allocator

See also