Removed all uses of nested functions as they only work with gcc and
cause the stack to be marked as executable in order for them to work.

All assembler files have also had a declaration added so that the
object they generate will be marked as not needing an executable stack.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2446 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/massif/ms_main.c b/massif/ms_main.c
index 584da10..44b865a 100644
--- a/massif/ms_main.c
+++ b/massif/ms_main.c
@@ -856,10 +856,9 @@
 static UInt   curr_census = 0;
 
 // Must return False so that all stacks are traversed
-static UInt count_stack_size_counter;
-static Bool count_stack_size( Addr stack_min, Addr stack_max )
+static Bool count_stack_size( Addr stack_min, Addr stack_max, void *cp )
 {
-   count_stack_size_counter += (stack_max - stack_min);
+   *(UInt *)cp  += (stack_max - stack_min);
    return False;
 }
 
@@ -1079,10 +1078,9 @@
 
    // Stack(s) ---------------------------------------------------------
    if (clo_stacks) {
-      count_stack_size_counter = sigstacks_space;
+      census->stacks_space = sigstacks_space;
       // slightly abusing this function
-      VG_(first_matching_thread_stack)( count_stack_size );
-      census->stacks_space = count_stack_size_counter;
+      VG_(first_matching_thread_stack)( count_stack_size, &census->stacks_space );
       i++;
    }