This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 2/2] Use gdbarch obstack to allocate the TYPE_NAME string in arch_type
- From: Doug Evans <xdje42 at gmail dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 01 Sep 2015 22:11:33 -0700
- Subject: Re: [PATCH 2/2] Use gdbarch obstack to allocate the TYPE_NAME string in arch_type
- Authentication-results: sourceware.org; auth=none
- References: <CA+C-WL9MJMGm8xEJMeHzWC-A=s2qPAty76S2q3FgRf=pnfi7KA at mail dot gmail dot com> <1440887600-22980-1-git-send-email-patrick at parcs dot ath dot cx>
Patrick Palka <email@example.com> writes:
> [ The earlier committed version of this patch was reverted. ]
> Since the type whose name is being set is now being allocated on the
> gdbarch obstack, we should allocate its TYPE_NAME on the obstack too.
> This reduces the number of individual valgrind warnings for the command
> "gdb gdb" from ~300 to ~150.
> Tested on x86_64-unknown-linux-gnu.
> * gdb_obstack.h (obstack_strdup): Declare.
> * gdb_obstack.c (obstack_strdup): Declare.
> * gdbarch.sh (gdbarch_obstack_strdup): Declare and define.
> * gdbarch.c: Regenerate.
> * gdbarch.h: Regenerate.
> * gdbtypes.c (arch_type): Use gdbarch_obstack_strdup.