diff options
author | Carsten Haitzler <raster@rasterman.com> | 2012-06-17 01:12:16 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2012-06-17 01:12:16 +0000 |
commit | cd57af5578dbe49ebf3eb89d9634d67fce5e7101 (patch) | |
tree | 86b7d2fed200c901bc724bb49c09db7db338f8c3 | |
parent | 196aed8a511c097a89efd86b33324abf6be4c250 (diff) | |
download | eina-cd57af5578dbe49ebf3eb89d9634d67fce5e7101.tar.gz |
add EINA_MEMPOOL_PASS
SVN revision: 72248
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/eina_mempool.c | 12 |
2 files changed, 14 insertions, 4 deletions
@@ -296,3 +296,9 @@ 2012-06-08 Mike Blumenkrantz * Fixed eina_str_split_full() to behave properly and be much faster + +2012-06-17 Carsten Haitzler (The Rasterman) + + * Add env var EINA_MEMPOOL_PASS to force mempool to try use + passthrough to malloc for debgging purposes and memory footrpint + comparisons at runtime. diff --git a/src/lib/eina_mempool.c b/src/lib/eina_mempool.c index 065532e..385ea15 100644 --- a/src/lib/eina_mempool.c +++ b/src/lib/eina_mempool.c @@ -65,15 +65,19 @@ _new_va(const char *name, const char *options, va_list args) { - Eina_Mempool_Backend *be; + Eina_Mempool_Backend *be = NULL; Eina_Mempool *mp; Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE; eina_error_set(0); - be = eina_hash_find(_backends, name); - if ((!be) || (!be->init)) - goto on_error; + if (getenv("EINA_MEMPOOL_PASS")) + { + be = eina_hash_find(_backends, "pass_through"); + if (!be) be = eina_hash_find(_backends, name); + } + else be = eina_hash_find(_backends, name); + if ((!be) || (!be->init)) goto on_error; err = EINA_ERROR_OUT_OF_MEMORY; mp = calloc(1, sizeof(Eina_Mempool)); |