diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-10 16:23:56 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-10 07:08:14 -0700 |
commit | b596a3c77da2387d7e5a3855717d65ce33bdfb58 (patch) | |
tree | 8031414899706c82056f981b6811beb2c06e8e3f /gdb/psymtab.h | |
parent | a9342b62885d5119593fa4330924e031e14c6406 (diff) | |
download | gdb-b596a3c77da2387d7e5a3855717d65ce33bdfb58.zip gdb-b596a3c77da2387d7e5a3855717d65ce33bdfb58.tar.gz gdb-b596a3c77da2387d7e5a3855717d65ce33bdfb58.tar.bz2 |
Make psymtab_storage::free_psymtabs private
This adds a new psymtab allocation method to psymtab_storage and
changes the free_psymtabs member to be private. While not strictly
necessary, this seems like a decent cleanup, and also makes it simpler
to move psymtabs off of obstacks entirely, should that prove
desirable.
gdb/ChangeLog
2019-01-10 Tom Tromey <tom@tromey.com>
* psymtab.h (psymtab_storage::allocate_psymtab): New method.
<free_psymtabs>: Now private.
* psymtab.c (psymtab_storage::allocate_psymtab): Implement.
(allocate_psymtab): Use new method.
Diffstat (limited to 'gdb/psymtab.h')
-rw-r--r-- | gdb/psymtab.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/psymtab.h b/gdb/psymtab.h index 57570e3..a21e88f 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -71,6 +71,12 @@ public: return OBSTACK_CALLOC (obstack (), number, struct partial_symtab *); } + /* Allocate a new psymtab on the psymtab obstack. The new psymtab + will be linked in to the "psymtabs" list, but otherwise all other + fields will be zero. */ + + struct partial_symtab *allocate_psymtab (); + /* Each objfile points to a linked list of partial symtabs derived from this file, one partial symtab structure for each compilation unit @@ -85,10 +91,6 @@ public: struct addrmap *psymtabs_addrmap = nullptr; - /* List of freed partial symtabs, available for re-use. */ - - struct partial_symtab *free_psymtabs = nullptr; - /* A byte cache where we can stash arbitrary "chunks" of bytes that will not change. */ @@ -102,6 +104,10 @@ public: private: + /* List of freed partial symtabs, available for re-use. */ + + struct partial_symtab *free_psymtabs = nullptr; + /* The obstack where allocations are made. */ struct obstack *m_obstack; |