aboutsummaryrefslogtreecommitdiff
path: root/COPYING3
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-02 12:29:48 -0700
committerTom Tromey <tom@tromey.com>2019-03-15 16:02:10 -0600
commit042d75e42c5572f333e0e06dabd3c5c4afab486c (patch)
tree32f8606eabd734669d29684d828893393fe29b51 /COPYING3
parentdb92718b541158d4782dbc9f48401c20f2bbad6d (diff)
downloadgdb-042d75e42c5572f333e0e06dabd3c5c4afab486c.zip
gdb-042d75e42c5572f333e0e06dabd3c5c4afab486c.tar.gz
gdb-042d75e42c5572f333e0e06dabd3c5c4afab486c.tar.bz2
Allocate minimal symbols with malloc
Currently, minimal symbols are allocated on the per-BFD obstack. However, it is also possible for multiple symbol readers to create minimal symbols for a given objfile. In this case, the minimal symbols will be reallocated on the obstack, leading to some waste of storage. This is a memory leak, but I think it won't be caught by tools like valgrind, because valgrind doesn't know about obstacks. This patch fixes the problem by using malloc to allocate the storage for minimal symbols. gdb/ChangeLog 2019-03-15 Tom Tromey <tom@tromey.com> * objfiles.h (struct objfile_per_bfd_storage) <msymbols>: Now a unique_xmalloc_ptr. (objfile::msymbols_range::begin, objfile::msymbols_range::end): Update. * minsyms.c (lookup_minimal_symbol_by_pc_section) (build_minimal_symbol_hash_tables) (minimal_symbol_reader::install): Update.
Diffstat (limited to 'COPYING3')
0 files changed, 0 insertions, 0 deletions