]> sourceware.org Git - libabigail.git/commitdiff
btf-reader: Add missing data members reset to reader::initialize
authorDodji Seketeli <dodji@redhat.com>
Fri, 21 Jun 2024 15:04:40 +0000 (17:04 +0200)
committerDodji Seketeli <dodji@redhat.com>
Fri, 21 Jun 2024 16:46:35 +0000 (18:46 +0200)
btf::reader::initialize forgets to reset a few data members used
during binary type information loading.  This resetting is key to get
the reader ready for being re-used to load a new binary, like a kernel
module.  Otherwise, the working set just keeps growing unnecessarily.

* src/abg-btf-reader.cc (btf::reader::initialize): Clear
types_to_canonicalize_, btf_type_id_to_artifacts_ and cur_tu_.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-btf-reader.cc

index a8131fd75f8bc955f72c93f4fec7a5decfbdcf40..e4aca24f9ff8aecf0c7d85ec2cff3e86412fb8f5 100644 (file)
@@ -240,6 +240,9 @@ protected:
   {
     btf__free(btf_handle_);
     btf_handle_ = nullptr;
+    types_to_canonicalize_.clear();
+    btf_type_id_to_artifacts_.clear();
+    cur_tu_.reset();
     elf_based_reader::initialize(elf_path, debug_info_root_paths);
     options().load_all_types = load_all_types;
     options().load_in_linux_kernel_mode = linux_kernel_mode;
This page took 0.029967 seconds and 5 git commands to generate.