rename 'MyAlloc' to 'ModelAlloc'
authorBrian Norris <banorris@uci.edu>
Wed, 3 Oct 2012 18:50:35 +0000 (11:50 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 3 Oct 2012 18:50:35 +0000 (11:50 -0700)
cyclegraph.cc
model.h
mymemory.h
nodestack.h
workqueue.h

index 321ebe9e2f242babe1adad4e233dd7fe51427e71..aa3d24548a554ab039074282f5bab3246e3d3ccd 100644 (file)
@@ -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 a2d33432de948e4bc64b48ca6d7c1c7596f1a20f..7241765d38c5270a33cf25a4986f5dd6fbd9a776 100644 (file)
--- 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
index 1d4c123ef141134bdf246f07b25c965204921154..47a7ae0b6974a75327fba5d00e7a4ef3b1669af1 100644 (file)
@@ -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;
  }
 
index 7402aa57d107aac938faab66ea13782ffaff3609..8df67838c87c362518bdd3100bddcd4663254475 100644 (file)
@@ -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
index 71067bbb9435054c32ecd0fe17c048ac28d38a3b..f08f63c783596968e9dd13a5595fa1f23fcd865f 100644 (file)
@@ -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__ */