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
This commit is contained in:
Cedric Bail 2019-09-14 10:49:28 -07:00
parent 2064112684
commit 4ab4b59757
1 changed files with 2 additions and 1 deletions

View File

@ -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;