-void SnapshotStack::snapshotStep(int seqindex) {
- struct stackEntry *tmp=(struct stackEntry *)model_malloc(sizeof(struct stackEntry));
- tmp->next=stack;
- tmp->index=seqindex;
- tmp->snapshotid=takeSnapshot();
- stack=tmp;
+void SnapshotStack::snapshotStep(int seqindex)
+{
+ stack.push_back(snapshot_entry(take_snapshot(), seqindex));
+}
+
+void snapshot_stack_init()
+{
+ snap_stack = new SnapshotStack();
+ SnapshotGlobalSegments();
+}
+
+void snapshot_record(int seq_index)
+{
+ snap_stack->snapshotStep(seq_index);
+}
+
+int snapshot_backtrack_before(int seq_index)
+{
+ return snap_stack->backTrackBeforeStep(seq_index);