cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4ab4b5975750e8a1b12ba044d7261714d29a1f63

commit 4ab4b5975750e8a1b12ba044d7261714d29a1f63
Author: Cedric Bail <[email protected]>
Date:   Sat Sep 14 10:49:28 2019 -0700

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D9939
---
 src/modules/eina/mp/one_big/eina_one_big.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 

-- 


Reply via email to