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>
{
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;