59 #ifndef __RKHMEMPOOL_H__
60 #define __RKHMEMPOOL_H__
79 #if RKH_CFG_MP_SIZEOF_NBLOCK == 8
81 #elif RKH_CFG_MP_SIZEOF_NBLOCK == 16
83 #elif RKH_CFG_MP_SIZEOF_NBLOCK == 32
94 #if RKH_CFG_MP_SIZEOF_BSIZE == 8
96 #elif RKH_CFG_MP_SIZEOF_BSIZE == 16
98 #elif RKH_CFG_MP_SIZEOF_BSIZE == 32
232 #if RKH_CFG_MP_REDUCED_EN == RKH_DISABLED
256 #if RKH_CFG_MP_GET_LWM_EN == RKH_ENABLED
266 #if RKH_CFG_MP_GET_INFO_EN == RKH_ENABLED
void rkh_memPool_get_info(RKH_MEMPOOL_T *mp, RKH_MPI_T *mpi)
Retrieves performance information for a particular memory pool.
void rkh_memPool_put(RKH_MEMPOOL_T *mp, void *blk)
When the application is done with the memory block, it must be returned to the appropiate memory pool...
void rkh_memPool_init(RKH_MEMPOOL_T *mp, void *sstart, rui16_t ssize, RKH_MPBS_T bsize)
Initializes the previously allocated memory pool data strcuture RKH_MEMPOOL_T.
RKH_MPBS_T rkh_memPool_get_bsize(RKH_MEMPOOL_T *mp)
Retrieves the size of memory block in bytes.
RKH_MPNB_T rkh_memPool_get_nfree(RKH_MEMPOOL_T *mp)
Retrieves the current number of free memory blocks in the pool.
void rkh_memPool_clear_info(RKH_MEMPOOL_T *mp)
Clear performance information for a particular memory pool.
void * rkh_memPool_get(RKH_MEMPOOL_T *mp)
Get a memory block from one of the previously allocated memory pool.
RKH_MPNB_T rkh_memPool_get_low_wmark(RKH_MEMPOOL_T *mp)
Retrieves the lowest number of free blocks ever present in the pool. This number provides valuable em...
Defines the data types that uses RKH.
Defines the data structure used to memory block pool facility.
RKH_MPNB_T nblocks
Total number of blocks in bytes.
RKH_MPBS_T bsize
Maximum block size in bytes.
RKH_MPNB_T nmin
Minimum number of free blocks ever in this pool, i.e. holds the lowest number of free blocks ever pre...
void * start
The start of the original pool buffer.
void * end
The last block in this pool.
void * free
The head of the linked list of free blocks.
RKH_MPNB_T nfree
Number of free blocks remaining.
Defines the data structure into which the performance information for memory pools is stored.
rui8_t puts
Number of put memory block requests.
rui8_t full
Number of full retrieves.
rui8_t free
Number of no free retrieves.
rui8_t gets
Number of get memory block requests.
rui8_t inits
Number of pool create requests.