Unit 'Exec' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#aros]

CreatePool

Create a new pool for memory allocations

Declaration

Source position: exec.pas line 1327

function CreatePool(

  Requirements: LongWord;

  PuddleSize: LongWord;

  ThreshSize: LongWord

):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