include/listelem_alloc.h File Reference

Fast memory allocator for uniformly sized objects. More...

#include <stdlib.h>
#include <sphinxbase_export.h>
#include <prim_type.h>

Go to the source code of this file.

Defines

#define listelem_malloc(le)   __listelem_malloc__((le),__FILE__,__LINE__)
 Macro of __listelem_malloc__.
#define listelem_free(le, el)   __listelem_free__((le),(el),__FILE__,__LINE__)
 Macro of __listelem_free__.

Typedefs

typedef struct listelem_alloc_s listelem_alloc_t
 List element allocator object.

Functions

SPHINXBASE_EXPORT
listelem_alloc_t
listelem_alloc_init (size_t elemsize)
 Initialize and return a list element allocator.
SPHINXBASE_EXPORT void listelem_alloc_free (listelem_alloc_t *le)
 Finalize and release all memory associated with a list element allocator.
SPHINXBASE_EXPORT void * __listelem_malloc__ (listelem_alloc_t *le, char *file, int line)
 Allocate a list element and return pointer to it.
SPHINXBASE_EXPORT void __listelem_free__ (listelem_alloc_t *le, void *elem, char *file, int line)
 Free list element of given size.
SPHINXBASE_EXPORT void listelem_stats (listelem_alloc_t *le)
 Print number of allocation, numer of free operation stats.

Detailed Description

Fast memory allocator for uniformly sized objects.

Author:
M K Ravishankar <rkm@cs.cmu.edu>

Definition in file listelem_alloc.h.


Generated on 19 Feb 2010 for SphinxBase by  doxygen 1.6.1