Unit 'exec' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

CreatePool

Create a new pool for memory allocations

Declaration

Source position: exec.pas line 2137

function CreatePool(

  requirements: Cardinal;

  puddleSize: Cardinal;

  threshSize: Cardinal

):Pointer;

Arguments

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)

Function result

A pointer to the new pool, or nil for error.

Description

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.

See also

DeletePool

  

Free a memory pool

AllocPooled

  

Allocate memory in a memory pool

FreePooled

  

Free pooled memory block


Documentation generated on: 2021-07-30