--- libelwix/src/mem.c 2014/01/29 14:11:45 1.2.28.1 +++ libelwix/src/mem.c 2015/06/25 00:36:48 1.4.18.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: mem.c,v 1.2.28.1 2014/01/29 14:11:45 misho Exp $ +* $Id: mem.c,v 1.4.18.1 2015/06/25 00:36:48 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2015 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -407,7 +407,8 @@ mpool_free(mpool_t * __restrict mp, void * __restrict int idx; struct tagAlloc *m, *tmp; - assert(data); + if (!data) + return 0; if (!mp) { elwix_SetErr(EINVAL, "Pool not specified"); return -1; @@ -732,4 +733,16 @@ char * mpool_xstrdup(const char *str) { return mpool_strdup(elwix_mpool, str, elwix_Prog); +} + +/* + * mpool_xstatistics() - elwix memory pool statistics wrapper + * + * @cb = Export statistics to callback + * return: none + */ +void +mpool_xstatistics(mpool_stat_cb cb) +{ + mpool_statistics(elwix_mpool, cb); }