summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2019-09-14 10:49:28 -0700
committerMike Blumenkrantz <zmike@samsung.com>2019-09-18 09:20:09 -0400
commitc5c3b04b5c718bf7a3ea974d00f1acf23ead943e (patch)
treee8c8a9ff2b1de7c9846e7862cd2673f59d6bdb86
parent715fac11a29dc9e547f399a58f4a411ba8c55b9d (diff)
downloadefl-c5c3b04b5c718bf7a3ea974d00f1acf23ead943e.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;