evas: check EINA_MEMPOOL env var when creating evas mempool allocators
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 5 Feb 2016 19:34:29 +0000 (14:34 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 5 Feb 2016 19:35:28 +0000 (14:35 -0500)
this should really be a utility function already since all mempools in efl use
the exact same code...

src/lib/evas/include/evas_private.h

index 91cdbe7..de135e0 100644 (file)
@@ -1953,7 +1953,10 @@ struct _Evas_Mempool
 # define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
    do { \
      if (!x.mp) { \
-       x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \
+       const char *tmp, *choice = "chained_mempool"; \
+       tmp = getenv("EINA_MEMPOOL"); \
+       if (tmp && tmp[0]) choice = tmp; \
+       x.mp = eina_mempool_add(choice, nam, NULL, sizeof(siz), cnt); \
        if (!x.mp) { \
          return ret; \
        } \