|
From: <sv...@va...> - 2015-06-18 21:01:43
|
Author: florian
Date: Thu Jun 18 22:01:35 2015
New Revision: 15342
Log:
Minor tweaks:
Make AM_SANITY_CHECK function-like.
Change preen_nsegments return type to void as nobody
cares about the result.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Thu Jun 18 22:01:35 2015
@@ -321,7 +321,7 @@
static Addr aspacem_vStart = 0;
-#define AM_SANITY_CHECK \
+#define AM_SANITY_CHECK() \
do { \
if (VG_(clo_sanity_level >= 3)) \
aspacem_assert(VG_(am_do_sync_check) \
@@ -702,9 +702,9 @@
/* Sanity-check and canonicalise the segment array (merge mergable
segments). Returns True if any segments were merged. */
-static Bool preen_nsegments ( void )
+static void preen_nsegments ( void )
{
- Int i, r, w, nsegments_used_old = nsegments_used;
+ Int i, r, w;
/* Pass 1: check the segment array covers the entire address space
exactly once, and also that each segment is sane. */
@@ -733,8 +733,6 @@
w++;
aspacem_assert(w > 0 && w <= nsegments_used);
nsegments_used = w;
-
- return nsegments_used != nsegments_used_old;
}
@@ -1011,7 +1009,7 @@
/* Hook to allow sanity checks to be done from aspacemgr-common.c. */
void ML_(am_do_sanity_check)( void )
{
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
}
@@ -1459,7 +1457,7 @@
nsegments[iLo] = *seg;
- (void)preen_nsegments();
+ preen_nsegments();
if (0) VG_(am_show_nsegments)(0,"AFTER preen (add_segment)");
}
@@ -1730,7 +1728,7 @@
VG_(am_show_nsegments)(2, "With contents of /proc/self/maps");
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return suggested_clstack_end;
}
@@ -1932,7 +1930,7 @@
if (floatIdx >= 0)
aspacem_assert(nsegments[floatIdx].kind == SkFree);
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
/* Now see if we found anything which can satisfy the request. */
switch (req->rkind) {
@@ -2054,7 +2052,7 @@
}
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2085,7 +2083,7 @@
seg.hasW = toBool(prot & VKI_PROT_WRITE);
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2135,8 +2133,8 @@
/* Changing permissions could have made previously un-mergable
segments mergeable. Therefore have to re-preen them. */
- (void)preen_nsegments();
- AM_SANITY_CHECK;
+ preen_nsegments();
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2173,7 +2171,7 @@
/* Unmapping could create two adjacent free segments, so a preen is
needed. add_segment() will do that, so no need to here. */
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
}
/* Notifies aspacem that an munmap completed successfully. The
@@ -2285,7 +2283,7 @@
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2343,7 +2341,7 @@
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2401,7 +2399,7 @@
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2499,7 +2497,7 @@
seg.hasX = True;
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2590,7 +2588,7 @@
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
/* Map privately a file at an unconstrained address for V, and update the
@@ -2818,7 +2816,7 @@
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return True;
}
@@ -2933,7 +2931,7 @@
aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
}
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return nsegments + segA;
}
@@ -3182,12 +3180,12 @@
SizeT seg_old_len = seg->end + 1 - seg->start;
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
sres = ML_(am_do_extend_mapping_NO_NOTIFY)( seg->start,
seg_old_len,
seg_old_len + delta );
if (sr_isError(sres)) {
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return NULL;
} else {
/* the area must not have moved */
@@ -3201,7 +3199,7 @@
if (0)
VG_(am_show_nsegments)(0, "VG_(am_extend_map_client) AFTER");
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return nsegments + find_nsegment_idx(addr);
}
@@ -3254,7 +3252,7 @@
sres = ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)
( old_addr, old_len, new_addr, new_len );
if (sr_isError(sres)) {
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return False;
} else {
aspacem_assert(sr_Res(sres) == new_addr);
|