|
From: <sv...@va...> - 2005-09-15 09:31:49
|
Author: sewardj
Date: 2005-09-15 10:31:45 +0100 (Thu, 15 Sep 2005)
New Revision: 4667
Log:
Use the correct segment preening function.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-15 09:14:1=
2 UTC (rev 4666)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-15 09:31:4=
5 UTC (rev 4667)
@@ -499,6 +499,7 @@
{
Int i, j, rd, wr;
Segment *s, *s1;
+ aspacem_barf("preen_segments");
vg_assert(segments_used >=3D 0 && segments_used < VG_N_SEGMENTS);
vg_assert(segnames_used >=3D 0 && segnames_used < VG_N_SEGNAMES);
=20
@@ -1810,11 +1811,11 @@
=20
=20
/* Sanity-check and canonicalise the segment array (merge mergable
- segments). */
+ segments). Returns True if any segments were merged. */
=20
-static void preen_nsegments ( void )
+static Bool preen_nsegments ( void )
{
- Int i, r, w;
+ Int i, r, w, nsegments_used_old =3D nsegments_used;
=20
/* Pass 1: check the segment array covers the entire address space
exactly once, and also that each segment is sane. */
@@ -1843,6 +1844,8 @@
w++;
aspacem_assert(w > 0 && w <=3D nsegments_used);
nsegments_used =3D w;
+
+ return nsegments_used !=3D nsegments_used_old;
}
=20
=20
@@ -2116,7 +2119,7 @@
=20
nsegments[iLo] =3D *seg;
=20
- preen_nsegments();
+ (void)preen_nsegments();
if (0) VG_(am_show_nsegments)(0,"AFTER preen (add_segment)");
}
=20
@@ -2580,7 +2583,7 @@
=20
/* Changing permissions could have made previously un-mergable
segments mergeable. Therefore have to re-preen them. */
- preen_segments();
+ (void)preen_nsegments();
}
=20
=20
@@ -2606,8 +2609,7 @@
add_segment( &seg );
=20
/* Unmapping could create two adjacent free segments, so a preen is
- needed. */
- preen_segments();
+ needed. add_segment() will do that, so no need to here. */
}
=20
=20
|