]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
clo_processing is now done when this procedure is called.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 26 Apr 2014 22:50:08 +0000 (22:50 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 26 Apr 2014 22:50:08 +0000 (22:50 +0000)
So, we can now allocate this memory only when approx history level
is requested.

I double checked using printf that clo processing was done before
this procedure is called.

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

helgrind/libhb_core.c

index d2047c66437bde1e8e937dbddcbf0c15a7d4f790..277e565a5566a8288edc977fbcf3eb3f3c09a0d2 100644 (file)
@@ -3668,14 +3668,11 @@ static Thr* Thr__new ( void )
    thr->llexit_done = False;
    thr->joinedwith_done = False;
    thr->filter = HG_(zalloc)( "libhb.Thr__new.2", sizeof(Filter) );
-   /* We only really need this at history level 1, but unfortunately
-      this routine is called before the command line processing is
-      done (sigh), so we can't rely on HG_(clo_history_level) at this
-      point.  Hence always allocate it.  Bah. */
-   thr->local_Kws_n_stacks
-      = VG_(newXA)( HG_(zalloc),
-                    "libhb.Thr__new.3 (local_Kws_and_stacks)",
-                    HG_(free), sizeof(ULong_n_EC) );
+   if (HG_(clo_history_level) == 1)
+      thr->local_Kws_n_stacks
+         = VG_(newXA)( HG_(zalloc),
+                       "libhb.Thr__new.3 (local_Kws_and_stacks)",
+                       HG_(free), sizeof(ULong_n_EC) );
 
    /* Add this Thr* <-> ThrID binding to the mapping, and
       cross-check */