]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Update a comment. Apparently the code was refactored at some point...
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 2 Mar 2015 21:10:46 +0000 (21:10 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 2 Mar 2015 21:10:46 +0000 (21:10 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14973

coregrind/m_signals.c
coregrind/m_syswrap/syswrap-main.c

index deecebe27e4870e25b69d9f9954a0ba0c5ab8eeb..1cd3179d7b10a51c85b87fd0f762f79260c25249 100644 (file)
@@ -2260,6 +2260,10 @@ Bool VG_(extend_stack)(Addr addr, UInt maxsize)
       = 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;
index ac1d7bef5ed439162ecc19901c0e606708aed3ba..0d42d16f029b7ef2b75fccce865932cb066a1730 100644 (file)
@@ -1464,28 +1464,15 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc )
       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)