57 #ifndef __RKHMEMPOOL_H__
58 #define __RKHMEMPOOL_H__
77 #if RKH_CFG_MP_SIZEOF_NBLOCK == 8
79 #elif RKH_CFG_MP_SIZEOF_NBLOCK == 16
81 #elif RKH_CFG_MP_SIZEOF_NBLOCK == 32
92 #if RKH_CFG_MP_SIZEOF_BSIZE == 8
94 #elif RKH_CFG_MP_SIZEOF_BSIZE == 16
96 #elif RKH_CFG_MP_SIZEOF_BSIZE == 32
230 #if RKH_CFG_MP_REDUCED_EN == RKH_DISABLED
254 #if RKH_CFG_MP_GET_LWM_EN == RKH_ENABLED
264 #if RKH_CFG_MP_GET_INFO_EN == RKH_ENABLED
Defines the data structure used to memory block pool facility.
rui8_t inits
Number of pool create requests.
rui8_t gets
Number of get memory block requests.
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.
Defines the data structure into which the performance information for memory pools is stored...
rui8_t full
Number of full retrieves.
RKH_MPBS_T bsize
Maximum block size in bytes.
void * start
The start of the original pool buffer.
RKH_MPNB_T nfree
Number of free blocks remaining.
void * end
The last block in this pool.
void rkh_memPool_get_info(RKH_MEMPOOL_T *mp, RKH_MPI_T *mpi)
Retrieves 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.
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...
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.
rui8_t puts
Number of put memory block requests.
RKH_MPNB_T nmin
Minimum number of free blocks ever in this pool, i.e. holds the lowest number of free blocks ever pre...
rui8_t free
Number of no free retrieves.
RKH_MPNB_T nblocks
Total number of blocks in bytes.
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...
void rkh_memPool_clear_info(RKH_MEMPOOL_T *mp)
Clear performance information for a particular memory pool.
Defines the data types that uses RKH.
void * free
The head of the linked list of free blocks.