From 3b39a4cdcd7eafca5480e9d9bdec4d24fe5441b3 Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Wed, 3 Oct 2012 11:50:35 -0700
Subject: [PATCH] rename 'MyAlloc' to 'ModelAlloc'

---
 cyclegraph.cc |  2 +-
 model.h       |  2 +-
 mymemory.h    | 20 ++++++++++----------
 nodestack.h   | 14 +++++++-------
 workqueue.h   |  2 +-
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/cyclegraph.cc b/cyclegraph.cc
index 321ebe9e..aa3d2454 100644
--- a/cyclegraph.cc
+++ b/cyclegraph.cc
@@ -173,7 +173,7 @@ bool CycleGraph::checkReachable(const ModelAction *from, const ModelAction *to)
  * @return True, @a from can reach @a to; otherwise, false
  */
 bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) {
-	std::vector<CycleNode *, MyAlloc<CycleNode *> > queue;
+	std::vector<CycleNode *, ModelAlloc<CycleNode *> > queue;
 	HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> discovered;
 
 	queue.push_back(from);
diff --git a/model.h b/model.h
index a2d33432..7241765d 100644
--- a/model.h
+++ b/model.h
@@ -26,7 +26,7 @@ class CycleGraph;
 class Promise;
 
 /** @brief Shorthand for a list of release sequence heads */
-typedef std::vector< const ModelAction *, MyAlloc<const ModelAction *> > rel_heads_list_t;
+typedef std::vector< const ModelAction *, ModelAlloc<const ModelAction *> > rel_heads_list_t;
 
 /**
  * Model checker parameter structure. Holds run-time configuration options for
diff --git a/mymemory.h b/mymemory.h
index 1d4c123e..47a7ae0b 100644
--- a/mymemory.h
+++ b/mymemory.h
@@ -61,7 +61,7 @@ void *system_malloc( size_t size );
  * warranty, and with no claim as to its suitability for any purpose.
  */
 template <class T>
-   class MyAlloc {
+   class ModelAlloc {
      public:
        // type definitions
        typedef T        value_type;
@@ -75,7 +75,7 @@ template <class T>
        // rebind allocator to type U
        template <class U>
        struct rebind {
-           typedef MyAlloc<U> other;
+           typedef ModelAlloc<U> other;
        };
 
        // return address of values
@@ -89,14 +89,14 @@ template <class T>
        /* constructors and destructor
         * - nothing to do because the allocator has no state
         */
-       MyAlloc() throw() {
+       ModelAlloc() throw() {
        }
-       MyAlloc(const MyAlloc&) throw() {
+       ModelAlloc(const ModelAlloc&) throw() {
        }
        template <class U>
-         MyAlloc (const MyAlloc<U>&) throw() {
+         ModelAlloc (const ModelAlloc<U>&) throw() {
        }
-       ~MyAlloc() throw() {
+       ~ModelAlloc() throw() {
        }
 
        // return maximum number of elements that can be allocated
@@ -130,15 +130,15 @@ template <class T>
 
 /** Return that all specializations of this allocator are interchangeable. */
  template <class T1, class T2>
- bool operator== (const MyAlloc<T1>&,
-                  const MyAlloc<T2>&) throw() {
+ bool operator== (const ModelAlloc<T1>&,
+                  const ModelAlloc<T2>&) throw() {
      return true;
  }
 
 /** Return that all specializations of this allocator are interchangeable. */
  template <class T1, class T2>
- bool operator!= (const MyAlloc<T1>&,
-                  const MyAlloc<T2>&) throw() {
+ bool operator!= (const ModelAlloc<T1>&,
+                  const ModelAlloc<T2>&) throw() {
      return false;
  }
 
diff --git a/nodestack.h b/nodestack.h
index 7402aa57..8df67838 100644
--- a/nodestack.h
+++ b/nodestack.h
@@ -98,24 +98,24 @@ private:
 	ModelAction *action;
 	Node *parent;
 	int num_threads;
-	std::vector< bool, MyAlloc<bool> > explored_children;
-	std::vector< bool, MyAlloc<bool> > backtrack;
-	std::vector< struct fairness_info, MyAlloc< struct fairness_info> > fairness;
+	std::vector< bool, ModelAlloc<bool> > explored_children;
+	std::vector< bool, ModelAlloc<bool> > backtrack;
+	std::vector< struct fairness_info, ModelAlloc< struct fairness_info> > fairness;
 	int numBacktracks;
 	bool *enabled_array;
 
 	/** The set of ModelActions that this the action at this Node may read
 	 *  from. Only meaningful if this Node represents a 'read' action. */
-	std::vector< const ModelAction *, MyAlloc< const ModelAction * > > may_read_from;
+	std::vector< const ModelAction *, ModelAlloc< const ModelAction * > > may_read_from;
 
 	unsigned int read_from_index;
 
-	std::vector< struct future_value, MyAlloc<struct future_value> > future_values;
-	std::vector< promise_t, MyAlloc<promise_t> > promises;
+	std::vector< struct future_value, ModelAlloc<struct future_value> > future_values;
+	std::vector< promise_t, ModelAlloc<promise_t> > promises;
 	int future_index;
 };
 
-typedef std::vector< Node *, MyAlloc< Node * > > node_list_t;
+typedef std::vector< Node *, ModelAlloc< Node * > > node_list_t;
 
 /**
  * @brief A stack of nodes
diff --git a/workqueue.h b/workqueue.h
index 71067bbb..f08f63c7 100644
--- a/workqueue.h
+++ b/workqueue.h
@@ -102,6 +102,6 @@ class MOEdgeWorkEntry : public WorkQueueEntry {
 };
 
 /** @brief typedef for the work queue type */
-typedef std::list< WorkQueueEntry, MyAlloc<WorkQueueEntry> > work_queue_t;
+typedef std::list< WorkQueueEntry, ModelAlloc<WorkQueueEntry> > work_queue_t;
 
 #endif /* __WORKQUEUE_H__ */
-- 
2.34.1