Skip to content

Commit

Permalink
remove copy constructor from backend and use a share method instead
Browse files Browse the repository at this point in the history
  • Loading branch information
linh2931 committed Aug 26, 2023
1 parent 7d184fb commit b79fd16
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions include/eosio/vm/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ namespace eosio { namespace vm {
construct();
}

backend& operator=(const backend& other) {
if (this != &other) {
mod = other.mod;
exec_ctx_created_by_backend = other.exec_ctx_created_by_backend;
initial_max_call_depth = other.initial_max_call_depth;
initial_max_pages = other.initial_max_pages;
}
return *this;
}

~backend() {
if (exec_ctx_created_by_backend && ctx) {
Expand Down Expand Up @@ -179,6 +170,13 @@ namespace eosio { namespace vm {
}
}

void share(const backend& from) {
mod = from.mod;
exec_ctx_created_by_backend = from.exec_ctx_created_by_backend;
initial_max_call_depth = from.initial_max_call_depth;
initial_max_pages = from.initial_max_pages;
}

void set_context(context_t* ctx_ptr) {
// ctx cannot be set if it is created by the backend
assert(!exec_ctx_created_by_backend);
Expand Down

0 comments on commit b79fd16

Please sign in to comment.