[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Exec' (#aros)

CreatePool

Create a new pool for memory allocations

Declaration

Source position: exec.pas line 1324

function CreatePool(

  Requirements: ULONG;

  PuddleSize: ULONG;

  ThreshSize: ULONG

):APTR;

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: 2017-01-10