[RFA] Don't allocate too much memory
David S. Miller
davem@redhat.com
Sat Apr 20 01:52:00 GMT 2002
This piece of code only needs to allocate SPARC_INTREG_SIZE * 16 bytes
of space, it allocates REGISTER_BYTES which is a lot on sparc64!
No testsuite changes after these changes, but less memory is used
by the debugger, and judging by xmalloc/xfree traces I did of
gdb the other week that can only be a good thing :-)
2002-04-20 David S. Miller <davem@redhat.com>
* sparc-tdep.c (sparc_pop_frame): Only need to allocate
SPARC_INTREG_SIZE * 16 bytes for reg_temp.
--- sparc-tdep.c.~1~ Sat Apr 20 00:34:53 2002
+++ sparc-tdep.c Sat Apr 20 01:46:27 2002
@@ -1263,7 +1263,7 @@ sparc_pop_frame (void)
char *reg_temp;
- reg_temp = alloca (REGISTER_BYTES);
+ reg_temp = alloca (SPARC_INTREG_SIZE * 16);
read_memory (fsr[I0_REGNUM], raw_buffer, 8 * SPARC_INTREG_SIZE);
More information about the Gdb-patches
mailing list