Memory Pool

Description

Memory Pool.

Macros

#define SLI_MEM_POOL_PAD_OBJECT_SIZE(block_size)   (block_size + sizeof(uint32_t) - 1)
 
#define SLI_MEM_POOL_BUFFER_SIZE(block_size, block_count)
 
#define SLI_MEM_POOL_DECLARE_BUFFER(mempool_name, block_size, block_count)   static uint32_t mempool_name##_buffer[SLI_MEM_POOL_BUFFER_SIZE(block_size, block_count)]
 Helper macro to create a memory pool buffer.
 

Macro Definition Documentation

◆ SLI_MEM_POOL_BUFFER_SIZE

#define SLI_MEM_POOL_BUFFER_SIZE (   block_size,
  block_count 
)
Value:
(block_count \
* SLI_MEM_POOL_PAD_OBJECT_SIZE(block_size) \
/ sizeof(uint32_t))

◆ SLI_MEM_POOL_DECLARE_BUFFER

#define SLI_MEM_POOL_DECLARE_BUFFER (   mempool_name,
  block_size,
  block_count 
)    static uint32_t mempool_name##_buffer[SLI_MEM_POOL_BUFFER_SIZE(block_size, block_count)]

Helper macro to create a memory pool buffer.

Parameters
[in]mempool_nameName of memory pool.
[in]block_sizeSize of the blocks.
[in]block_countNumber of blocks in pool.