From ec504bc26364a29ce7d1fb8fa15357d164efcba0 Mon Sep 17 00:00:00 2001 From: raster Date: Sun, 17 Jun 2012 01:12:16 +0000 Subject: [PATCH] add EINA_MEMPOOL_PASS git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@72248 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 6 ++++++ src/lib/eina_mempool.c | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4384f17..38ea340 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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)); -- 2.7.4