diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2019-12-16 16:30:50 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2019-12-16 16:30:50 -0500 |
commit | 0394eed15c5bf24943850f356785152c3d65ab94 (patch) | |
tree | 7c1327661892bd302782015b43c39cb7904bf271 /gdb/infcmd.c | |
parent | b61121178ec07f9da1242e439fe1a23a314ad30e (diff) | |
download | binutils-0394eed15c5bf24943850f356785152c3d65ab94.zip binutils-0394eed15c5bf24943850f356785152c3d65ab94.tar.gz binutils-0394eed15c5bf24943850f356785152c3d65ab94.tar.bz2 |
jit: make gdb_symtab::blocks an std::forward_list
This patch changes the gdb_symtab::blocks manually maintained linked
list to be an std::forward_list, simplifying memory management.
Currently, the list is sorted as blocks are created. With an
std::forward_list, it is easier (and probably a bit more efficient) to
sort them once at the end, so this is what I did.
A note about the comment on the "next" field:
/* gdb_blocks are linked into a tree structure. Next points to the
next node at the same depth as this block and parent to the
parent gdb_block. */
I don't think it's true that "next" points to the next node at the same
depth. All nodes are in a simple singly linked list, so necessarily
some node will point to some other node that isn't at the same depth.
gdb/ChangeLog:
* jit.c (struct gdb_block) <next>: Remove field.
(struct gdb_symtab) <~gdb_symtab>: Remove.
<blocks>: Change type to std::forward_list<gdb_block>.
(compare_block): Remove.
(jit_block_open_impl): Adjust to std::forward_list. Place the new
block at the beginning, don't mind about sorting.
(finalize_symtab): Adjust to std::forward_list, sort the blocks list
before using it.
Diffstat (limited to 'gdb/infcmd.c')
0 files changed, 0 insertions, 0 deletions