Commit 991a1df2 authored by Teng Qin's avatar Teng Qin

Add move constructor for BPFStackTable

parent 913450f1
......@@ -157,6 +157,13 @@ BPFStackTable::BPFStackTable(const TableDesc& desc,
};
}
BPFStackTable::BPFStackTable(BPFStackTable&& that) :
BPFTableBase<int, stacktrace_t>(that.desc),
symbol_option_(std::move(that.symbol_option_)),
pid_sym_(std::move(that.pid_sym_)) {
that.pid_sym_.clear();
}
BPFStackTable::~BPFStackTable() {
for (auto it : pid_sym_)
bcc_free_symcache(it.second, it.first);
......
......@@ -289,6 +289,7 @@ class BPFStackTable : public BPFTableBase<int, stacktrace_t> {
BPFStackTable(const TableDesc& desc,
bool use_debug_file,
bool check_debug_file_crc);
BPFStackTable(BPFStackTable&& that);
~BPFStackTable();
void clear_table_non_atomic();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment