Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Creates a dynamic memory pool. Memory blocks will be padded according to memory segment's properties.

Files

lib_mem.h/lib_mem.c

Prototype

Arguments

p_name

Pointer to pool name.

p_pool

Pointer to pool data.

p_seg

Pointer to segment from which to allocate memory.

blk_size

Size of memory block to allocate from pool, in bytes. See Note #1.

blk_align

Required alignment of memory block, in bytes. MUST be a power of 2.

blk_qty_init

Initial number of elements to be allocated in pool.

blk_qty_max

Maximum number of elements that can be allocated from this pool. Set to LIB_MEM_BLK_QTY_UNLIMITED if no limit.

p_err

Pointer to variable that will receive the return error code from this function.

LIB_MEM_ERR_NONE

LIB_MEM_ERR_INVALID_MEM_ALIGN

LIB_MEM_ERR_INVALID_MEM_SIZE

LIB_MEM_ERR_NULL_PTR

LIB_MEM_ERR_SEG_OVF

Returned Value

None.

Required Configuration

None.

Notes / Warnings

  1. An usage example of this function is available on Dynamic Memory Pools page.

 

  • No labels