This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PA-RISC diffs, part 6: malloc fix for up-growing stacks


A bit of generic code that was not properly conditionalized for stack
direction.

2000-10-12  Alan Modra <alan@linuxcare.com.au>

        * malloc/memusage.c: Conditionalize stack usage calculation on
          stack direction.

diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/malloc/memusage.c glibc/malloc/memusage.c
--- glibc-2.1.95/malloc/memusage.c	Tue Jun 20 00:45:05 2000
+++ glibc/malloc/memusage.c	Tue Oct  3 13:11:02 2000
@@ -117,7 +117,11 @@
     peak_heap = current_heap;
 
   /* Compute current stack usage and compare it with the maximum value.  */
+#ifdef STACK_GROWS_UPWARD
+  current_stack = GETSP () - start_sp;
+#else
   current_stack = start_sp - GETSP ();
+#endif
   if (current_stack > peak_stack)
     peak_stack = current_stack;
 


-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]