This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH] [PR gdb/17143] Improve memory usage of major obstacks


On 09/21/2015 12:04 AM, Doug Evans wrote:
> Hi.
> 
> 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.).

Thanks,
Pedro Alves


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