From: Brian Norris Date: Mon, 8 Oct 2012 20:46:11 +0000 (-0700) Subject: utilize SnapshotAlloc STL allocator X-Git-Tag: pldi2013~82 X-Git-Url: http://demsky.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=d96312573c237eb9648976be85de39261c9531c6 utilize SnapshotAlloc STL allocator --- diff --git a/action.h b/action.h index 65b060f..96b791e 100644 --- a/action.h +++ b/action.h @@ -157,6 +157,6 @@ private: ClockVector *cv; }; -typedef std::list action_list_t; +typedef std::list< ModelAction *, SnapshotAlloc > action_list_t; #endif /* __ACTION_H__ */ diff --git a/model.cc b/model.cc index 31e0694..538b4a9 100644 --- a/model.cc +++ b/model.cc @@ -32,10 +32,10 @@ ModelChecker::ModelChecker(struct model_params params) : obj_map(new HashTable()), lock_waiters_map(new HashTable()), obj_thrd_map(new HashTable, uintptr_t, 4 >()), - promises(new std::vector()), - futurevalues(new std::vector()), - pending_rel_seqs(new std::vector()), - thrd_last_action(new std::vector(1)), + promises(new std::vector< Promise *, SnapshotAlloc >()), + futurevalues(new std::vector< struct PendingFutureValue, SnapshotAlloc >()), + pending_rel_seqs(new std::vector< struct release_seq *, SnapshotAlloc >()), + thrd_last_action(new std::vector< ModelAction *, SnapshotAlloc >(1)), node_stack(new NodeStack()), mo_graph(new CycleGraph()), failed_promise(false), @@ -1478,7 +1478,7 @@ void ModelChecker::get_release_seq_heads(ModelAction *act, rel_heads_list_t *rel bool ModelChecker::resolve_release_sequences(void *location, work_queue_t *work_queue) { bool updated = false; - std::vector::iterator it = pending_rel_seqs->begin(); + std::vector< struct release_seq *, SnapshotAlloc >::iterator it = pending_rel_seqs->begin(); while (it != pending_rel_seqs->end()) { struct release_seq *pending = *it; ModelAction *act = pending->acquire; diff --git a/model.h b/model.h index 7bc3585..1bd32a1 100644 --- a/model.h +++ b/model.h @@ -186,8 +186,8 @@ private: HashTable *lock_waiters_map; HashTable, uintptr_t, 4 > *obj_thrd_map; - std::vector *promises; - std::vector *futurevalues; + std::vector< Promise *, SnapshotAlloc > *promises; + std::vector< struct PendingFutureValue, SnapshotAlloc > *futurevalues; /** * List of pending release sequences. Release sequences might be @@ -195,9 +195,9 @@ private: * are established. Each entry in the list may only be partially * filled, depending on its pending status. */ - std::vector *pending_rel_seqs; + std::vector< struct release_seq *, SnapshotAlloc > *pending_rel_seqs; - std::vector *thrd_last_action; + std::vector< ModelAction *, SnapshotAlloc > *thrd_last_action; NodeStack *node_stack; /** Private data members that should be snapshotted. They are grouped diff --git a/threads.h b/threads.h index 7f005c0..9fecdfd 100644 --- a/threads.h +++ b/threads.h @@ -126,7 +126,7 @@ private: * list is used for thread joins, where another Thread waits for this * Thread to complete */ - std::vector wait_list; + std::vector< ModelAction *, SnapshotAlloc > wait_list; /** * The value returned by the last action in this thread