eina-cow: fix valgrind instrumentation

This commit is contained in:
Boris 'billiob' Faure 2013-03-20 21:18:49 +01:00
parent 07b5c33f90
commit 61c50e9d1c
1 changed files with 8 additions and 1 deletions

View File

@ -484,8 +484,15 @@ eina_cow_done(Eina_Cow *cow,
if (!needed_gc) return ;
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_DEFINED(ref, sizeof (*ref));
#endif
/* needed if we want to make cow gc safe */
if (ref->togc) return ;
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(ref, sizeof (*ref));
#endif
gc = eina_mempool_malloc(gc_pool, sizeof (Eina_Cow_GC));
if (!gc) return ; /* That one will not get gced this time */
@ -493,10 +500,10 @@ eina_cow_done(Eina_Cow *cow,
gc->ref = ref;
gc->dst = dst;
eina_hash_direct_add(cow->togc, &gc->ref, gc);
ref->togc = EINA_TRUE;
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_DEFINED(ref, sizeof (*ref));
#endif
ref->togc = EINA_TRUE;
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(ref, sizeof (*ref));
#endif