Create a new pool for memory allocations
Source position: exec.pas line 1221
function CreatePool( |
requirements: LongWord; |
puddleSize: LongWord; |
threshSize: LongWord |
):POINTER; |
requirements |
|
Memory flags requirement (MEMF_*), all puddles will have this requirement. |
puddleSize |
|
Size of puddles |
threshSize |
|
The largest allocation that goes into normal puddles This MUST be less than or equal to puddleSize (CreatePool() will fail if it is not) |
A pointer to the new pool, or nil for error.
Each pool is a separate tracking system for memory of a specific type. Any number of pools may exist in the system.
Pools automatically expand and shrink based on demand. Fixed sized "puddles" are allocated by the pool manager when more total memory is needed. Many small allocations can fit in a single puddle. Allocations larger than the threshSize are allocation in their own puddles.
At any time individual allocations may be freed. Or, the entire pool may be removed in a single step.
|
Free a memory pool |
|
|
Allocate memory in a memory pool |
|
|
Free pooled memory block |