This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Don't allocate too much memory


"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);
>


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