How much the pool has handed out: the bytes used in ordinary blocks (including their headers and alignment padding) and the number of oversized blocks.
pool: Pool;
defer release(*pool);
get(*pool, 100);
bytes, oversized := calculate_used_memory(pool);
assert(bytes >= 100 && oversized == 0);
get(*pool, 100000);
bytes, oversized = calculate_used_memory(pool);
assert(oversized == 1);calculate_used_memory :: (pool: Pool) -> (inband_size: s64, outband_count: s64)
How much the pool has handed out: the bytes used in ordinary blocks (including their headers and alignment padding) and the number of oversized blocks.
Parameters
- pool: Pool
Returns
- inband_size: s64
- outband_count: s64
pool: Pool;
defer release(*pool);
get(*pool, 100);
bytes, oversized := calculate_used_memory(pool);
assert(bytes >= 100 && oversized == 0);
get(*pool, 100000);
bytes, oversized = calculate_used_memory(pool);
assert(oversized == 1);