summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-09-04 03:08:33 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-09-04 03:12:57 -0700
commitc9a0237770a7fb0f1d94c9f99b7cab68399a922f (patch)
treebc7245a9a2e1817894c3d018c9642bdeb033c15e /src/modules
parentbf1c0e2657259ab6d6c7ac44408bc46429c9d1c9 (diff)
eina: properly track valgrind use of the mempool.
T5966
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/eina/mp/chained_pool/eina_chained_mempool.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
index ec24b3a..5913f87 100644
--- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
+++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
@@ -378,6 +378,9 @@ eina_chained_mempool_from(void *data, void *ptr)
378 Eina_Rbtree *r; 378 Eina_Rbtree *r;
379 Chained_Pool *p; 379 Chained_Pool *p;
380 Eina_Trash *t; 380 Eina_Trash *t;
381#ifndef NVALGRIND
382 Eina_Trash *last;
383#endif
381 void *pmem; 384 void *pmem;
382 Eina_Bool ret = EINA_FALSE; 385 Eina_Bool ret = EINA_FALSE;
383 386
@@ -420,8 +423,19 @@ eina_chained_mempool_from(void *data, void *ptr)
420 } 423 }
421 424
422 // Check if the pointer was freed 425 // Check if the pointer was freed
423 for (t = p->base; t != NULL; t = t->next) 426 for (t = p->base, last = NULL; t != NULL; t = t->next)
424 if (t == ptr) goto end; 427 {
428#ifndef NVALGRIND
429 VALGRIND_MAKE_MEM_DEFINED(t, pool->item_alloc);
430 if (last) VALGRIND_MAKE_MEM_NOACCESS(last, pool->item_alloc);
431 last = t;
432#endif
433
434 if (t == ptr) goto end;
435 }
436#ifndef NVALGRIND
437 if (last) VALGRIND_MAKE_MEM_NOACCESS(last, pool->item_alloc);
438#endif
425 439
426 // Seems like we have a valid pointer actually 440 // Seems like we have a valid pointer actually
427 ret = EINA_TRUE; 441 ret = EINA_TRUE;