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 5 Current »

Creates and initializes a memory pool.

This function is deprecated and will be removed in a future version of this product.

Files

lib_mem.h/lib_mem.c

Prototype

Arguments

pmem_pool

Pointer to a memory pool structure to create.

pmem_base_addr

Memory pool base address:

NULL address

Memory pool allocated from general-purpose heap;

Non-NULL address

Memory pool allocated from dedicated memory specified by non-NULL base address.

mem_size

Size of memory pool segment (in octets).

blk_nbr

Number of memory pool blocks to create.

blk_size

Size of memory pool blocks to create (in octets).

blk_align

Alignment of memory pool blocks to create (in octets).

poctets_reqd

Pointer to a variable to …

Return the number of octets required to successfully allocate the memory pool, if any errors;

Return 0, otherwise.

perr

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

LIB_MEM_ERR_NONE
LIB_MEM_ERR_NULL_PTR
LIB_MEM_ERR_HEAP_NOT_FOUND
LIB_MEM_ERR_HEAP_EMPTY
LIB_MEM_ERR_HEAP_OVF
LIB_MEM_ERR_SEG_EMPTY
LIB_MEM_ERR_SEG_OVF
LIB_MEM_ERR_INVALID_SEG_SIZE
LIB_MEM_ERR_INVALID_SEG_OVERLAP
LIB_MEM_ERR_INVALID_BLK_NBR
LIB_MEM_ERR_INVALID_BLK_SIZE
LIB_MEM_ERR_INVALID_BLK_ALIGN

Returned Value

None.

Required Configuration

Available only if LIB_MEM_CFG_HEAP_SIZE is > 0 in lib_cfg.h.

Notes / Warnings

pmem_pool must be passed a valid pointer to the address of a declared MEM_POOL variable.

Example Usage

  • No labels