From 3b39a4cdcd7eafca5480e9d9bdec4d24fe5441b3 Mon Sep 17 00:00:00 2001 From: Brian Norris 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 > queue; + std::vector > queue; HashTable 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 > rel_heads_list_t; +typedef std::vector< const ModelAction *, ModelAlloc > 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 MyAlloc { + class ModelAlloc { public: // type definitions typedef T value_type; @@ -75,7 +75,7 @@ template // rebind allocator to type U template struct rebind { - typedef MyAlloc other; + typedef ModelAlloc other; }; // return address of values @@ -89,14 +89,14 @@ template /* 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 - MyAlloc (const MyAlloc&) throw() { + ModelAlloc (const ModelAlloc&) throw() { } - ~MyAlloc() throw() { + ~ModelAlloc() throw() { } // return maximum number of elements that can be allocated @@ -130,15 +130,15 @@ template /** Return that all specializations of this allocator are interchangeable. */ template - bool operator== (const MyAlloc&, - const MyAlloc&) throw() { + bool operator== (const ModelAlloc&, + const ModelAlloc&) throw() { return true; } /** Return that all specializations of this allocator are interchangeable. */ template - bool operator!= (const MyAlloc&, - const MyAlloc&) throw() { + bool operator!= (const ModelAlloc&, + const ModelAlloc&) 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 > explored_children; - std::vector< bool, MyAlloc > backtrack; - std::vector< struct fairness_info, MyAlloc< struct fairness_info> > fairness; + std::vector< bool, ModelAlloc > explored_children; + std::vector< bool, ModelAlloc > 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 > future_values; - std::vector< promise_t, MyAlloc > promises; + std::vector< struct future_value, ModelAlloc > future_values; + std::vector< promise_t, ModelAlloc > 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 > work_queue_t; +typedef std::list< WorkQueueEntry, ModelAlloc > work_queue_t; #endif /* __WORKQUEUE_H__ */ -- 2.34.1