|
From: <sv...@va...> - 2015-02-16 23:04:59
|
Author: florian
Date: Mon Feb 16 23:04:53 2015
New Revision: 14937
Log:
Update comment for VG_(am_find_nsegment) to match the code.
Likewise for VG_(am_next_nsegment). Also make the code similar to
VG_(am_find_nsegment) for easier comprehension.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c Mon Feb 16 23:04:53 2015
@@ -1185,10 +1185,7 @@
}
-
-/* Finds the segment containing 'a'. Only returns file/anon/resvn
- segments. This returns a 'NSegment const *' - a pointer to
- readonly data. */
+/* Finds the segment containing 'a'. Only returns non-SkFree segments. */
NSegment const * VG_(am_find_nsegment) ( Addr a )
{
Int i = find_nsegment_idx(a);
@@ -1211,8 +1208,7 @@
}
-/* Find the next segment along from 'here', if it is a file/anon/resvn
- segment. */
+/* Find the next segment along from 'here', if it is a non-SkFree segment. */
NSegment const * VG_(am_next_nsegment) ( const NSegment* here, Bool fwds )
{
Int i = segAddr_to_index(here);
@@ -1226,14 +1222,10 @@
if (i < 0)
return NULL;
}
- switch (nsegments[i].kind) {
- case SkFileC: case SkFileV: case SkShmC:
- case SkAnonC: case SkAnonV: case SkResvn:
- return &nsegments[i];
- default:
- break;
- }
- return NULL;
+ if (nsegments[i].kind == SkFree)
+ return NULL;
+ else
+ return &nsegments[i];
}
|