Expand description
The direct-mapping path.
Requests past the largest size class get their own mapping and give it straight back on release: no pooling, no span, and therefore no slack — a direct mapping is exactly as big as it needs to be, page rounding aside.
§Why these counters are per process and not per heap
A large block has no segment, so nothing records which heap it came
from, so a free arriving on another thread has nowhere to be routed.
Whichever thread frees it is the one that unmaps it. Per-heap
counters would therefore drift negative the first time a large
allocation crossed a thread — the same defect the small path settles
through the foreign list, but with nowhere to settle it. The process
figure is the one that is meaningful, so it is the one kept, and
large_stats stays out of Heap::snapshot so that summing shards
cannot count it once per shard.
Functions§
- large_
stats - Direct-mapping figures for the whole process.