Import with #import "std/pool".

PoolHandle :: struct { index: s32; generation: u32; }
Pool :: struct($T: Type) { items: Vec(T); generations: Vec(u32); occupied: Vec(u8); free_list: Vec(s32); live_count: s64; }
PoolValid :: (pool: *Pool($T), handle: PoolHandle) -> bool
PoolAlloc :: (pool: *Pool($T), value: T) -> PoolHandle
PoolGet :: (pool: *Pool($T), handle: PoolHandle, out: *T) -> bool
PoolGetMut :: (pool: *Pool($T), handle: PoolHandle) -> *T
PoolFree :: (pool: *Pool($T), handle: PoolHandle) -> bool
PoolLiveCount :: (pool: *Pool($T)) -> s64

Source ↗ · All modules