RKH

Specifies the interface of the fixed-size memory blocks facility. More...

#include "rkhtype.h"
#include "rkhcfg.h"
Include dependency graph for rkhmempool.h:

Go to the source code of this file.

Data Structures

struct  RKH_MPI_T
 Defines the data structure into which the performance information for memory pools is stored. More...
 
struct  RKH_MEMPOOL_T
 Defines the data structure used to memory block pool facility. More...
 

Typedefs

typedef rui8_t RKH_MPNB_T
  More...
 
typedef rui8_t RKH_MPBS_T
  More...
 

Functions

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. More...
 
void * rkh_memPool_get (RKH_MEMPOOL_T *mp)
 Get a memory block from one of the previously allocated memory pool. More...
 
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. The block must be allocated from the same memory pool to which it is returned. More...
 
RKH_MPBS_T rkh_memPool_get_bsize (RKH_MEMPOOL_T *mp)
 Retrieves the size of memory block in bytes. More...
 
RKH_MPNB_T rkh_memPool_get_nfree (RKH_MEMPOOL_T *mp)
 Retrieves the current number of free memory blocks in the pool. More...
 
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 empirical data for proper sizing of the memory pool. More...
 
void rkh_memPool_get_info (RKH_MEMPOOL_T *mp, RKH_MPI_T *mpi)
 Retrieves performance information for a particular memory pool. More...
 
void rkh_memPool_clear_info (RKH_MEMPOOL_T *mp)
 Clear performance information for a particular memory pool. More...
 

Detailed Description

Specifies the interface of the fixed-size memory blocks facility.

Definition in file rkhmempool.h.

Typedef Documentation

◆ RKH_MPNB_T

typedef rui8_t RKH_MPNB_T

Defines the size of number of memory block size. The valid values [in bits] are 8, 16 or 32. Default is 8. This type is configurable via the preprocessor switch RKH_CFG_MP_SIZEOF_NBLOCK.

Definition at line 80 of file rkhmempool.h.

◆ RKH_MPBS_T

typedef rui8_t RKH_MPBS_T

Defines the size of memory block size. The valid values [in bits] are 8, 16 or 32. Default is 8. This type is configurable via the preprocessor switch RKH_CFG_MP_SIZEOF_BSIZE.

Definition at line 95 of file rkhmempool.h.