Memory Pool Allocation
This functionality provides fixed-size memory allocation for message payloads using free-list pools with multi-pool fallback.
Static View
The following software units are involved in memory pool allocation:
- Memory Pool Management Unit: Manages multiple pools with different block sizes
(see Memory Pool Management for its class diagram)
Message Management Unit: Requests memory for message payloads
Memory pool allocation component view
Notes:
Aggregatorroutes requests to the appropriate pool based on size.Falls back to larger pools if smaller ones are exhausted.
Each pool uses a free-list with
pNext_chunkpointer chaining for fast allocation.Each free chunk contains a pointer to the next free chunk (or
nullptrif last).Allocation and deallocation are constant-time, O(1).
Dynamic View
The dynamic view illustrates memory allocation with pool selection and fallback.
Allocate
Memory pool allocation sequence
Deallocate
Memory pool deallocation sequence