eyBuildLib API Reference : eyBuildLib
ebmem - memory management lib
ebMemInit( ) - initialize memory management library
ebMalloc( ) - allocate a block of memory from the system memory partition
ebCalloc( ) - allocate space for an array
ebRealloc( ) - reallocate a block of memory
ebFree( ) - free a block of memory
ebStrdup( ) - make a copy of source string
ebMemDestroy( ) - destroy memory management library
ebMemStat( ) - get the statistic info about current management library.
ebMemStatShow( ) - output the memory statistic into stderr
eblist.h
ebMemInit( ) - initialize memory management library
int ebMemInit (void)
This routine is to initializes memory management library
OK/ERROR
ebMalloc( ) - allocate a block of memory from the system memory partition
void * ebMalloc ( size_t size, const char * file, int line )
This routine allocates a block of memory from the free list. The size of the block will be equal to or greater than nBytes.
A pointer to the allocated block of memory, or a null pointer if there is an error.
ebCalloc( ) - allocate space for an array
void * ebCalloc ( size_t num, size_t size, const char * file, int line )
This routine allocates a block of memory for an array that contains num elements of size size. This space is initialized to zeros.
A pointer to the block, or NULL if the call fails.
ebRealloc( ) - reallocate a block of memory
void * ebRealloc ( void * pbuf, size_t size, const char * file, int line )
This routine changes the size of a specified block of memory and returns a pointer to the new block of memory. The contents that fit inside the new size (or old size if smaller) remain unchanged. The memory alignment of the new block is not guaranteed to be the same as the original block.
A pointer to the new block of memory, or NULL if the call fails.
ebFree( ) - free a block of memory
void ebFree ( void * pbuf )
This routine returns to the free memory pool a block of memory previously allocated with malloc( ) or calloc( ).
N/A
ebStrdup( ) - make a copy of source string
char * ebStrdup ( const char * src, const char * file, int line )
this routine is to allocate a new space and make a copy of source string
pointer to new string, or NULL if allocate failure
ebMemDestroy( ) - destroy memory management library
void ebMemDestroy (void)
This routine is to destroy memory management library and free the remains memory allocated by ebMalloc( ) or ebCalloc( ).
N/A
ebMemStat( ) - get the statistic info about current management library.
int ebMemStat ( MEM_STAT * mstat )
This routine is to get the statistic info about current management library
N/A
ebMemStatShow( ) - output the memory statistic into stderr
int ebMemStatShow ( FILE * fp )
This routine is to output the memory statistic into stderr
OK/ERROR