This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] Don't allocate too much memory
- From: "David S. Miller" <davem at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 20 Apr 2002 01:43:25 -0700 (PDT)
- Subject: [RFA] Don't allocate too much memory
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);