]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Have the event map GC use the same approach as the other GC
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 10 Apr 2015 19:34:14 +0000 (19:34 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 10 Apr 2015 19:34:14 +0000 (19:34 +0000)
done from libhb_maybe_GC, i.e. check the condition in
libhb_maybe_GC, and call the (non inlined) GC only if
a GC is needed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15082

helgrind/libhb_core.c

index 35472ad0100968e68d715e265a1f64d13725b219..1bd771d4be00eec27e01e58b278c286178e3e120 100644 (file)
@@ -4491,7 +4491,7 @@ static void event_map__check_reference_counts ( Bool before )
 }
 
 __attribute__((noinline))
-static void event_map_maybe_GC ( void )
+static void event_map_GC ( void )
 {
    OldRef* oldref;
    UWord   keyW, valW, retained, maxGen;
@@ -4502,9 +4502,6 @@ static void event_map_maybe_GC ( void )
    UWord  genMap_min  = 0;
    UWord  genMap_size = 0;
 
-   if (LIKELY(oldrefTreeN < HG_(clo_conflict_cache_size)))
-      return;
-
    if (0)
       VG_(printf)("libhb: event_map GC at size %lu\n", oldrefTreeN);
 
@@ -6585,7 +6582,9 @@ void libhb_copy_shadow_state ( Thr* thr, Addr src, Addr dst, SizeT len )
 
 void libhb_maybe_GC ( void )
 {
-   event_map_maybe_GC();
+   if (UNLIKELY(oldrefTreeN >= HG_(clo_conflict_cache_size)))
+      event_map_GC();
+
    /* If there are still freelist entries available, no need for a
       GC. */
    if (vts_tab_freelist != VtsID_INVALID)