return false;
}
+/**
+ * Create a new clock vector for this action. Note that this function allows a
+ * user to clobber (and leak) a ModelAction's existing clock vector. A user
+ * should ensure that the vector has already either been rolled back
+ * (effectively "freed") or freed.
+ *
+ * @param parent A ModelAction from which to inherit a ClockVector
+ */
void ModelAction::create_cv(const ModelAction *parent)
{
- if (cv)
- delete cv;
-
if (parent)
cv = new ClockVector(parent->cv, this);
else
rel_heads_list_t release_heads;
model->get_release_seq_heads(this, &release_heads);
for (unsigned int i = 0; i < release_heads.size(); i++)
- synchronize_with(release_heads[i]);
+ if (!synchronize_with(release_heads[i]))
+ model->set_bad_synchronization();
}
}
return act->cv->synchronized_since(this);
}
-void ModelAction::print(void) const
+/**
+ * Print nicely-formatted info about this ModelAction
+ *
+ * @param print_cv True if we want to print clock vector data. Might be false,
+ * for instance, in situations where the clock vector might be invalid
+ */
+void ModelAction::print(bool print_cv) const
{
const char *type_str, *mo_str;
switch (this->type) {
else
printf(" Rf: ?");
}
- if (cv) {
+ if (cv && print_cv) {
printf("\t");
cv->print();
} else