Skip to content

Commit

Permalink
Add move constructor for BPFStackTable
Browse files Browse the repository at this point in the history
  • Loading branch information
palmtenor committed Mar 19, 2018
1 parent 913450f commit 991a1df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cc/api/BPFTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/cc/api/BPFTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 991a1df

Please sign in to comment.