|
From: <sv...@va...> - 2008-04-01 18:19:53
|
Author: bart
Date: 2008-04-01 19:19:50 +0100 (Tue, 01 Apr 2008)
New Revision: 7835
Log:
Slightly reduced stack space needed when reporting a data race.
Modified:
trunk/exp-drd/drd_error.c
Modified: trunk/exp-drd/drd_error.c
===================================================================
--- trunk/exp-drd/drd_error.c 2008-04-01 17:03:33 UTC (rev 7834)
+++ trunk/exp-drd/drd_error.c 2008-04-01 18:19:50 UTC (rev 7835)
@@ -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 @@
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 @@
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 @@
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)
|