summaryrefslogtreecommitdiff
path: root/src/modules
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 /src/modules
parent20641126842f9e89147ee19d970b4dc6ecf44e60 (diff)
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
Diffstat (limited to 'src/modules')
-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 @@
32#include "eina_log.h" 32#include "eina_log.h"
33#include "eina_lock.h" 33#include "eina_lock.h"
34#include "eina_thread.h" 34#include "eina_thread.h"
35#include "eina_cpu.h"
35 36
36#ifndef NVALGRIND 37#ifndef NVALGRIND
37# include <memcheck.h> 38# include <memcheck.h>
@@ -288,7 +289,7 @@ eina_one_big_init(const char *context,
288 item_size = va_arg(args, int); 289 item_size = va_arg(args, int);
289 if (item_size < 1) item_size = 1; 290 if (item_size < 1) item_size = 1;
290 291
291 pool->item_size = eina_mempool_alignof(item_size); 292 pool->item_size = MAX(eina_mempool_alignof(item_size), sizeof(void*));
292 pool->max = va_arg(args, int); 293 pool->max = va_arg(args, int);
293 if (pool->max < 1) pool->max = 1; 294 if (pool->max < 1) pool->max = 1;
294 295