From: Philippe Waroquiers Date: Sat, 26 Apr 2014 22:50:08 +0000 (+0000) Subject: clo_processing is now done when this procedure is called. X-Git-Tag: svn/VALGRIND_3_10_0~521 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49e538806015258aeebea4a83d72ffe0fc672c90;p=thirdparty%2Fvalgrind.git clo_processing is now done when this procedure is called. 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 --- diff --git a/helgrind/libhb_core.c b/helgrind/libhb_core.c index d2047c6643..277e565a55 100644 --- a/helgrind/libhb_core.c +++ b/helgrind/libhb_core.c @@ -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 */