* @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);
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
* 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;
// rebind allocator to type U
template <class U>
struct rebind {
- typedef MyAlloc<U> other;
+ typedef ModelAlloc<U> other;
};
// return address of values
/* 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
/** 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;
}
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
};
/** @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__ */