38 #ifndef __LISTELEM_ALLOC_H__
39 #define __LISTELEM_ALLOC_H__
59 #include <sphinxbase/sphinxbase_export.h>
86 #define listelem_malloc(le) __listelem_malloc__((le),__FILE__,__LINE__)
95 #define listelem_malloc_id(le, oid) __listelem_malloc_id__((le),__FILE__,__LINE__,(oid))
112 #define listelem_free(le,el) __listelem_free__((le),(el),__FILE__,__LINE__)
Basic type definitions used in Sphinx.
Fast linked list allocator.
SPHINXBASE_EXPORT void * listelem_get_item(listelem_alloc_t *le, int32 id)
Retrieve a list element by its identifier.
SPHINXBASE_EXPORT listelem_alloc_t * listelem_alloc_init(size_t elemsize)
Initialize and return a list element allocator.
size_t elemsize
Number of (char *) in element.
SPHINXBASE_EXPORT void listelem_stats(listelem_alloc_t *le)
Print number of allocation, numer of free operation stats.
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_alloc_free(listelem_alloc_t *le)
Finalize and release all memory associated with a list element allocator.