From 73de022597f45a327075153343c13af0bbe9ad0a Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 7 Jan 2013 17:38:25 -0800 Subject: [PATCH] model: add PendingFutureValue constructor --- model.cc | 5 ++--- model.h | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/model.cc b/model.cc index 98df8f3..bc17a88 100644 --- a/model.cc +++ b/model.cc @@ -871,7 +871,7 @@ bool ModelChecker::process_write(ModelAction *curr) pfv.act->get_node()->add_future_value(pfv.writer->get_value(), pfv.writer->get_seq_number() + params.maxfuturedelay)) set_latest_backtrack(pfv.act); } - futurevalues->resize(0); + futurevalues->clear(); } mo_graph->commitChanges(); @@ -1773,8 +1773,7 @@ bool ModelChecker::w_modification_order(ModelAction *curr) if (thin_air_constraint_may_allow(curr, act)) { if (!is_infeasible() || (curr->is_rmw() && act->is_rmw() && curr->get_reads_from() == act->get_reads_from() && !is_infeasible_ignoreRMW())) { - struct PendingFutureValue pfv = {curr, act}; - futurevalues->push_back(pfv); + futurevalues->push_back(PendingFutureValue(curr, act)); } } } diff --git a/model.h b/model.h index c97cbf1..414cf93 100644 --- a/model.h +++ b/model.h @@ -67,7 +67,8 @@ struct execution_stats { }; struct PendingFutureValue { - ModelAction *writer; + PendingFutureValue(ModelAction *writer, ModelAction *act) : writer(writer), act(act) { } + const ModelAction *writer; ModelAction *act; }; -- 2.34.1