|
From: <sv...@va...> - 2015-03-02 21:10:54
|
Author: florian
Date: Mon Mar 2 21:10:46 2015
New Revision: 14973
Log:
Update a comment. Apparently the code was refactored at some point...
Modified:
trunk/coregrind/m_signals.c
trunk/coregrind/m_syswrap/syswrap-main.c
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Mon Mar 2 21:10:46 2015
@@ -2260,6 +2260,10 @@
= seg ? VG_(am_next_nsegment)( seg, True/*fwds*/ )
: NULL;
+ /* TODO: the test "seg->kind == SkAnonC" is really inadequate,
+ because although it tests whether the segment is mapped
+ _somehow_, it doesn't check that it has the right permissions
+ (r,w, maybe x) ? */
if (seg && seg->kind == SkAnonC)
/* addr is already mapped. Nothing to do. */
return True;
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-main.c Mon Mar 2 21:10:46 2015
@@ -1464,28 +1464,15 @@
possible valid address for stack (sp - redzone), to ensure the
pages all the way down to that address, are mapped. Because
this is a potentially expensive and frequent operation, we
- filter in two ways:
+ do the following:
- First, only the main thread (tid=1) has a growdown stack. So
+ Only the main thread (tid=1) has a growdown stack. So
ignore all others. It is conceivable, although highly unlikely,
that the main thread exits, and later another thread is
allocated tid=1, but that's harmless, I believe;
VG_(extend_stack) will do nothing when applied to a non-root
thread.
- Secondly, first call VG_(am_find_nsegment) directly, to see if
- the page holding (sp - redzone) is mapped correctly. If so, do
- nothing. This is almost always the case. VG_(extend_stack)
- calls VG_(am_find_nsegment) twice, so this optimisation -- and
- that's all it is -- more or less halves the number of calls to
- VG_(am_find_nsegment) required.
-
- TODO: the test "seg->kind == SkAnonC" is really inadequate,
- because although it tests whether the segment is mapped
- _somehow_, it doesn't check that it has the right permissions
- (r,w, maybe x) ? We could test that here, but it will also be
- necessary to fix the corresponding test in VG_(extend_stack).
-
All this guff is of course Linux-specific. Hence the ifdef.
*/
# if defined(VGO_linux)
|