|
From: <sv...@va...> - 2009-05-24 07:53:39
|
Author: bart
Date: 2009-05-24 08:53:33 +0100 (Sun, 24 May 2009)
New Revision: 10129
Log:
Moved allocation of level-two bitmaps to a separate source file.
Added:
branches/DRDDEV/drd/drd_bitmap2_node.c
Modified:
branches/DRDDEV/drd/Makefile.am
branches/DRDDEV/drd/drd_bitmap.c
branches/DRDDEV/drd/pub_drd_bitmap.h
branches/DRDDEV/drd/tests/drd_bitmap_test.c
Modified: branches/DRDDEV/drd/Makefile.am
===================================================================
--- branches/DRDDEV/drd/Makefile.am 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/Makefile.am 2009-05-24 07:53:33 UTC (rev 10129)
@@ -94,6 +94,7 @@
DRD_SOURCES = \
drd_barrier.c \
+ drd_bitmap2_node.c \
drd_clientobj.c \
drd_clientreq.c \
drd_cond.c \
Modified: branches/DRDDEV/drd/drd_bitmap.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap.c 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/drd_bitmap.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -73,8 +73,8 @@
bm->cache[i].a1 = ~(UWord)1;
bm->cache[i].bm2 = 0;
}
- bm->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), "drd.bitmap.bn.2",
- VG_(free));
+ bm->oset = VG_(OSetGen_Create)(0, 0, DRD_(bm2_alloc_node),
+ "drd.bitmap.bn.2", DRD_(bm2_free_node));
s_bitmap_creation_count++;
Added: branches/DRDDEV/drd/drd_bitmap2_node.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap2_node.c (rev 0)
+++ branches/DRDDEV/drd/drd_bitmap2_node.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -0,0 +1,51 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+/*
+ This file is part of drd, a thread error detector.
+
+ Copyright (C) 2006-2009 Bart Van Assche <bar...@gm...>.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+
+#include "drd_basics.h" /* DRD_() */
+#include "pub_drd_bitmap.h"
+#include "pub_tool_basics.h" /* Addr, SizeT */
+#include "pub_tool_libcassert.h" /* tl_assert() */
+#include "pub_tool_mallocfree.h" /* VG_(malloc), VG_(free) */
+
+
+/* Local function declarations. */
+
+
+
+/* Local variables. */
+
+
+
+/* Function definitions. */
+
+void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB)
+{
+ return VG_(malloc)(ec, szB);
+}
+
+void DRD_(bm2_free_node)(void* const bm2)
+{
+ return VG_(free)(bm2);
+}
Modified: branches/DRDDEV/drd/pub_drd_bitmap.h
===================================================================
--- branches/DRDDEV/drd/pub_drd_bitmap.h 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/pub_drd_bitmap.h 2009-05-24 07:53:33 UTC (rev 10129)
@@ -125,4 +125,7 @@
ULong DRD_(bm_get_bitmap2_creation_count)(void);
ULong DRD_(bm_get_bitmap2_merge_count)(void);
+void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB);
+void DRD_(bm2_free_node)(void* const bm2);
+
#endif /* __PUB_DRD_BITMAP_H */
Modified: branches/DRDDEV/drd/tests/drd_bitmap_test.c
===================================================================
--- branches/DRDDEV/drd/tests/drd_bitmap_test.c 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/tests/drd_bitmap_test.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -5,6 +5,7 @@
#include <unistd.h>
#include "coregrind/m_oset.c"
#include "drd/drd_bitmap.c"
+#include "drd/drd_bitmap2_node.c"
#include "drd/pub_drd_bitmap.h"
|