This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Don't allocate too much memory
- From: Michael Snyder <msnyder at redhat dot com>
- To: "David S. Miller" <davem at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 23 Apr 2002 12:35:05 -0700
- Subject: Re: [RFA] Don't allocate too much memory
- Organization: Red Hat, Inc.
- References: <20020420.014325.94392942.davem@redhat.com>
"David S. Miller" wrote:
>
> 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 :-)
OK, please commit it.
>
> 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);
>