aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris 'billiob' Faure <billiob@gmail.com>2013-03-20 21:18:49 +0100
committerChris Michael <cp.michael@samsung.com>2013-03-26 08:53:34 +0000
commita2bccf3e533b2e95272de93bce6e9286b0c97af0 (patch)
tree8b4f77babde198a0b91a1302354649dcd70fc088
parenteina_test_list: Move fail_if out of the hot path (diff)
downloadefl-a2bccf3e533b2e95272de93bce6e9286b0c97af0.tar.gz
eina-cow: fix valgrind instrumentation
-rw-r--r--src/lib/eina/eina_cow.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/eina/eina_cow.c b/src/lib/eina/eina_cow.c
index 397f853dfb..55125906e2 100644
--- a/src/lib/eina/eina_cow.c
+++ b/src/lib/eina/eina_cow.c
@@ -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