Detailed Description

Fixed memory blocks pool.

A fixed-sized memory blocks pool is used for managing fixed-sized memory blocks dynamically. A pool has a memory area where fixed-sized memory blocks are allocated and the wait queue for acquiring a memory block. If there are no free memory blocks, a task trying to acquire a memory block will be placed into the wait queue until a free memory block arrives (another task returns it to the memory pool).

The operations of getting the block from memory pool and releasing it back take O(1) time independently of number or size of the blocks.

For the useful pattern on how to use fixed memory pool together with queue, refer to the example: examples/queue. Be sure to examine the readme there.

Start address of the memory block is returned through the p_data argument. The content of memory block is undefined. If there is no free block in the pool, behavior depends on timeout value: refer to TN_TickCnt.