public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/8] Remove obstack allocation of hash tables
Date: Wed, 05 Jun 2024 11:19:13 -0600	[thread overview]
Message-ID: <20240605-hash-tab-no-obstack-v1-0-aa10f4d46a8f@adacore.com> (raw)

Obstack allocation of hash tables has slightly irritated me for a long
time.  The main issue with these is that if the hash table is resized,
then the old table is not freed, but instead left around as unused
garbage.

This series removes this capability entirely.  IMO there's no reason
to ever do this -- with C++, heap allocation is just as convenient,
and doesn't cause effective memory leaks.

While working on this I found a few other minor cleanups to do.  This
series includes them all.

Regression tested on x86-64 Fedora 38.

---
Tom Tromey (8):
      Don't obstack-allocate the DIE hash
      Don't obstack-allocate the CU dependency hash table
      Rename symtab::fullname
      Make symtab members private
      Add compunit_symtab::forget_cached_source_info
      Don't obstack-allocate the call site hash table
      Remove hashtab_obstack_allocate
      Prefer htab_traverse_noresize

 gdb/annotate.c             |  2 +-
 gdb/completer.c            |  2 +-
 gdb/dwarf2/cu.c            | 13 +++++-----
 gdb/dwarf2/cu.h            |  6 ++---
 gdb/dwarf2/read.c          | 63 ++++++++++++++++------------------------------
 gdb/gdb_bfd.c              |  2 +-
 gdb/objfiles.c             |  2 ++
 gdb/python/py-breakpoint.c |  4 +--
 gdb/source.c               | 21 ++++++++--------
 gdb/symfile-debug.c        | 11 +-------
 gdb/symfile.c              |  1 -
 gdb/symmisc.c              |  4 +--
 gdb/symtab.c               | 23 +++++++++++++++--
 gdb/symtab.h               | 54 +++++++++++++++++++++++++++++++--------
 gdbsupport/Makefile.am     |  1 -
 gdbsupport/Makefile.in     |  5 +---
 gdbsupport/gdb-hashtab.cc  | 43 -------------------------------
 gdbsupport/gdb-hashtab.h   |  5 ----
 18 files changed, 116 insertions(+), 146 deletions(-)
---
base-commit: ecc5fed79101ba6af6ddc6e629e2d8d93c36065b
change-id: 20240605-hash-tab-no-obstack-91d863a9add4

Best regards,
-- 
Tom Tromey <tromey@adacore.com>


             reply	other threads:[~2024-06-05 17:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 17:19 Tom Tromey [this message]
2024-06-05 17:19 ` [PATCH 1/8] Don't obstack-allocate the DIE hash Tom Tromey
2024-06-05 17:19 ` [PATCH 2/8] Don't obstack-allocate the CU dependency hash table Tom Tromey
2024-06-05 17:19 ` [PATCH 3/8] Rename symtab::fullname Tom Tromey
2024-06-05 17:19 ` [PATCH 4/8] Make symtab members private Tom Tromey
2024-06-05 17:19 ` [PATCH 5/8] Add compunit_symtab::forget_cached_source_info Tom Tromey
2024-06-05 17:19 ` [PATCH 6/8] Don't obstack-allocate the call site hash table Tom Tromey
2024-06-05 17:19 ` [PATCH 7/8] Remove hashtab_obstack_allocate Tom Tromey
2024-06-05 17:19 ` [PATCH 8/8] Prefer htab_traverse_noresize Tom Tromey
2024-06-18 21:03 ` [PATCH 0/8] Remove obstack allocation of hash tables Keith Seitz
2024-06-24 15:11   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605-hash-tab-no-obstack-v1-0-aa10f4d46a8f@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).