Flat_Pool module

init

procedureSource

Reserves reserve bytes of address space for the pool (256 MiB by default) and sets it up. No memory is used until get touches pages.

Example
pool: Flat_Pool;
init(*pool, 1024 * 1024);
defer fini(*pool);
assert(get(*pool, 16) != null);

Doesn't run in the browser (skipped on wasm).

init :: (pool: *Flat_Pool, reserve := DEFAULT_VIRTUAL_MEMORY_RESERVE)

Parameters

pool: *Flat_Pool
reserve := DEFAULT_VIRTUAL_MEMORY_RESERVE

See also