From 3594ff85c07e29afe077fd9005200e0342991787 Mon Sep 17 00:00:00 2001 From: weiyu Date: Thu, 12 Sep 2019 14:03:28 -0700 Subject: [PATCH] Change action_list_buffer to snapshot memory instead of half-shapshot-half-non-snapshot --- funcnode.cc | 3 ++- funcnode.h | 4 ++-- history.cc | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/funcnode.cc b/funcnode.cc index 64972b4d..19601fac 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -7,13 +7,13 @@ FuncNode::FuncNode(ModelHistory * history) : func_inst_map(), inst_list(), entry_insts(), - action_list_buffer(), predicate_tree_position() { predicate_tree_entry = new Predicate(NULL, true); predicate_tree_entry->add_predicate_expr(NOPREDICATE, NULL, true); // memories that are reclaimed after each execution + action_list_buffer = new SnapList(); read_locations = new loc_set_t(); val_loc_map = new HashTable(); loc_may_equal_map = new HashTable(); @@ -30,6 +30,7 @@ void FuncNode::set_new_exec_flag() inst->unset_location(); } + action_list_buffer = new SnapList(); read_locations = new loc_set_t(); val_loc_map = new HashTable(); loc_may_equal_map = new HashTable(); diff --git a/funcnode.h b/funcnode.h index b022284a..c70bc59c 100644 --- a/funcnode.h +++ b/funcnode.h @@ -38,7 +38,7 @@ public: void incr_exit_count() { exit_count++; } uint32_t get_exit_count() { return exit_count; } - ModelList * get_action_list_buffer() { return &action_list_buffer; } + SnapList * get_action_list_buffer() { return action_list_buffer; } void add_to_val_loc_map(uint64_t val, void * loc); void add_to_val_loc_map(value_set_t * values, void * loc); @@ -83,7 +83,7 @@ private: bool amend_predicate_expr(Predicate ** curr_pred, FuncInst * next_inst, ModelAction * next_act); /* Store action_lists when calls to update_tree are deferred */ - ModelList action_list_buffer; + SnapList * action_list_buffer; /* read_locations: set of locations read by this FuncNode * val_loc_map: keep track of locations that have the same values written to; diff --git a/history.cc b/history.cc index 584b9f00..8a605fbf 100644 --- a/history.cc +++ b/history.cc @@ -69,7 +69,6 @@ void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid) FuncNode * func_node = func_nodes[func_id]; func_node->set_predicate_tree_position(tid, NULL); func_node->reset_inst_act_map(tid); - //func_node->clear_read_map(tid); action_list_t * curr_act_list = func_act_lists->back(); @@ -78,7 +77,7 @@ void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid) */ func_node->incr_exit_count(); if (func_node->get_exit_count() >= 2) { - ModelList * action_list_buffer = func_node->get_action_list_buffer(); + SnapList * action_list_buffer = func_node->get_action_list_buffer(); while (action_list_buffer->size() > 0) { action_list_t * act_list = action_list_buffer->back(); action_list_buffer->pop_back(); -- 2.34.1