From: Bart Van Assche Date: Tue, 1 Apr 2008 18:19:50 +0000 (+0000) Subject: Slightly reduced stack space needed when reporting a data race. X-Git-Tag: svn/VALGRIND_3_4_0~761 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05de9ea4b018bbd237b17e1fe755c9d080f63077;p=thirdparty%2Fvalgrind.git Slightly reduced stack space needed when reporting a data race. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7835 --- diff --git a/exp-drd/drd_error.c b/exp-drd/drd_error.c index 8851f612ae..ac496f050d 100644 --- a/exp-drd/drd_error.c +++ b/exp-drd/drd_error.c @@ -35,6 +35,7 @@ #include "pub_tool_libcfile.h" // VG_(get_startup_wd)() #include "pub_tool_libcprint.h" // VG_(printf)() #include "pub_tool_machine.h" +#include "pub_tool_mallocfree.h" // VG_(malloc), VG_(free) #include "pub_tool_threadstate.h" // VG_(get_pthread_id)() #include "pub_tool_tooliface.h" // VG_(needs_tool_errors)() @@ -71,8 +72,9 @@ static void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) { AddrInfo ai; - Char descr1[256]; - Char descr2[256]; + const unsigned descr_size = 256; + Char* descr1 = VG_(malloc)(descr_size); + Char* descr2 = VG_(malloc)(descr_size); tl_assert(dri); tl_assert(dri->addr); @@ -80,7 +82,7 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) descr1[0] = 0; descr2[0] = 0; - VG_(get_data_description)(descr1, descr2, sizeof(descr1), dri->addr); + VG_(get_data_description)(descr1, descr2, descr_size, dri->addr); if (descr1[0] == 0) { describe_malloced_addr(dri->addr, dri->size, &ai); @@ -115,6 +117,9 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) thread_report_conflicting_segments(dri->tid, dri->addr, dri->size, dri->access_type); } + + VG_(free)(descr2); + VG_(free)(descr1); } static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)