diff options
-rw-r--r-- | gdb/dwarf2/cu.c | 12 | ||||
-rw-r--r-- | gdb/dwarf2/cu.h | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c index a64cb1d..aae61cc 100644 --- a/gdb/dwarf2/cu.c +++ b/gdb/dwarf2/cu.c @@ -146,7 +146,7 @@ dwarf2_cu::mark () { m_mark = true; if (m_dependencies != nullptr) - htab_traverse (m_dependencies, dwarf2_mark_helper, per_objfile); + htab_traverse (m_dependencies.get (), dwarf2_mark_helper, per_objfile); } } @@ -158,13 +158,11 @@ dwarf2_cu::add_dependence (struct dwarf2_per_cu_data *ref_per_cu) void **slot; if (m_dependencies == nullptr) - m_dependencies - = htab_create_alloc_ex (5, htab_hash_pointer, htab_eq_pointer, - NULL, &comp_unit_obstack, - hashtab_obstack_allocate, - dummy_obstack_deallocate); + m_dependencies.reset (htab_create_alloc + (5, htab_hash_pointer, htab_eq_pointer, + nullptr, xcalloc, xfree)); - slot = htab_find_slot (m_dependencies, ref_per_cu, INSERT); + slot = htab_find_slot (m_dependencies.get (), ref_per_cu, INSERT); if (*slot == nullptr) *slot = ref_per_cu; } diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h index 94e73eb..d23cc9b 100644 --- a/gdb/dwarf2/cu.h +++ b/gdb/dwarf2/cu.h @@ -122,7 +122,7 @@ private: /* A set of pointers to dwarf2_per_cu_data objects for compilation units referenced by this one. Only set during full symbol processing; partial symbol tables do not have dependencies. */ - htab_t m_dependencies = nullptr; + htab_up m_dependencies; public: /* The generic symbol table building routines have separate lists for |