Memory allocator

POK also provides a memory allocator. This memory allocator was designed to be deterministic and highly configurable. You define the amount of memory for the memory allocator and the number of memory slices that can be allocated.

Consequently, the memory allocator can be configured with different maccros. The service is activated by defining the POK_CONFIG_NEEDS_ALLOCATOR maccro. Then, the POK_CONFIG_ALLOCATOR_MEMORY_SIZE is used to specify the amount of memory dedicated for the memory allocator. Finally the POK_CONFIG_ALLOCATOR_NB_SPACES specifies the number of spaces you can allocate with the memory allocator.

This memory allocator can be used with the legacy layer (with the pok_allocator_allocate() or pok_allocator_free() functions) or with the C-library layer (malloc(), free(), calloc()).



Copyright 2009 POK Team