This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] [PR gdb/17143] Improve memory usage of major obstacks
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <xdje42 at gmail dot com>, gdb-patches at sourceware dot org
- Date: Tue, 29 Sep 2015 12:40:32 +0100
- Subject: Re: [PATCH] [PR gdb/17143] Improve memory usage of major obstacks
- Authentication-results: sourceware.org; auth=none
- References: <m37fnkae0l dot fsf at seba dot sebabeach dot org>
On 09/21/2015 12:04 AM, Doug Evans wrote:
> The default obstack alignment on amd64-linux is 16 if one is using
> glibc's obstack instead of libiberty's (glibc's includes long double
> in the default alignment calculation).
> This wastes 10s of megabytes when debugging large programs.
> I couldn't find any case where we use long double or DOUBLEST in
> either of objfile's two obstacks: objfile_obstack, per_bfd->storage_obstack,
> so I'd like to propose this patch.
How about putting a gdb_static_assert in OBSTACK_ZALLOC, etc. that
ensures the alignment of the type is <= 10 ? We could restrict that
to gcc/clang and use __alignof__. (gnulib/import/stddef.in.h conditions
the __alignof__ usage on #ifdef __GNUC__, which both define.).