This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PA-RISC diffs, part 6: malloc fix for up-growing stacks
- To: Ulrich Drepper <drepper at cygnus dot com>
- Subject: PA-RISC diffs, part 6: malloc fix for up-growing stacks
- From: David Huggins-Daines <dhd at linuxcare dot com>
- Date: 12 Oct 2000 16:29:06 -0400
- CC: libc-alpha at sourceware dot cygnus dot com
- Organization: Linuxcare, Inc.
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.