aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2019-09-14 10:49:28 -0700
committerCedric Bail <cedric.bail@free.fr>2019-09-17 10:24:05 -0700
commit4ab4b5975750e8a1b12ba044d7261714d29a1f63 (patch)
tree640274b8233c94e0d4ce757c4aaa8f3589123642
parenteina: fix eina_mempool_from to not report pointer that have never been alloca... (diff)
downloadefl-4ab4b5975750e8a1b12ba044d7261714d29a1f63.tar.gz
eina: fix free support in eina OneBig mempool.
We use an Eina_Trash to store freed pointer, which require the item size to be at least the size of a pointer. There wasn't any test suite enable for OneBig mempool and we never used free on a small item size... Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9939
-rw-r--r--src/modules/eina/mp/one_big/eina_one_big.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/eina/mp/one_big/eina_one_big.c b/src/modules/eina/mp/one_big/eina_one_big.c
index c816970621..39fd511cf1 100644
--- a/src/modules/eina/mp/one_big/eina_one_big.c
+++ b/src/modules/eina/mp/one_big/eina_one_big.c
@@ -32,6 +32,7 @@
#include "eina_log.h"
#include "eina_lock.h"
#include "eina_thread.h"
+#include "eina_cpu.h"
#ifndef NVALGRIND
# include <memcheck.h>
@@ -288,7 +289,7 @@ eina_one_big_init(const char *context,
item_size = va_arg(args, int);
if (item_size < 1) item_size = 1;
- pool->item_size = eina_mempool_alignof(item_size);
+ pool->item_size = MAX(eina_mempool_alignof(item_size), sizeof(void*));
pool->max = va_arg(args, int);
if (pool->max < 1) pool->max = 1;