- struct stackEntry *tmp = (struct stackEntry *)model_malloc(sizeof(struct stackEntry));
- tmp->next = stack;
- tmp->index = seqindex;
- tmp->snapshotid = take_snapshot();
- stack = tmp;
+ 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);