summaryrefslogtreecommitdiff
path: root/src/context
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-10-12 14:09:54 +0000
committerMorgan Deters <mdeters@gmail.com>2010-10-12 14:09:54 +0000
commitec320b78deaaf31bdae1b8b048f66cfb1b3a4197 (patch)
treebf5fc292d26e49de97fe6c2eff6e2667d56c1895 /src/context
parentb4fb5a6ad511f20ff88d2bf78194ef2e65dbde39 (diff)
check last result in (get-assignment); some context cleanup
Diffstat (limited to 'src/context')
-rw-r--r--src/context/cdo.h7
-rw-r--r--src/context/context.h8
2 files changed, 11 insertions, 4 deletions
diff --git a/src/context/cdo.h b/src/context/cdo.h
index ba4b368a8..f4c4a7e29 100644
--- a/src/context/cdo.h
+++ b/src/context/cdo.h
@@ -143,11 +143,16 @@ public:
const T& get() const { return d_data; }
/**
- * For convenience, define operator T to be the same as get().
+ * For convenience, define operator T() to be the same as get().
*/
operator T() { return get(); }
/**
+ * For convenience, define operator const T() to be the same as get().
+ */
+ operator const T() const { return get(); }
+
+ /**
* For convenience, define operator= that takes an object of type T.
*/
CDO<T>& operator=(const T& data) {
diff --git a/src/context/context.h b/src/context/context.h
index 9a561abb6..053d5cb1a 100644
--- a/src/context/context.h
+++ b/src/context/context.h
@@ -246,6 +246,7 @@ public:
* creation of new Scope objects in the current memory region.
*/
static void* operator new(size_t size, ContextMemoryManager* pCMM) {
+ Trace("context_mm") << "Scope::new " << size << " in " << pCMM << std::endl;
return pCMM->newData(size);
}
@@ -329,12 +330,12 @@ public:
* memory, privately declare (but don't define) an operator
* new(size_t) and destructor (as currently in the Link class, in
* src/theory/uf/ecdata.h).
- *
+ *
* 2. For data structures that may or may not be allocated in context
* memory, and are designed to be that way (esp. if they contain
* ContextObj instances), they should be heavily documented --
* especially the destructor, since it _may_or_may_not_be_called_.
- *
+ *
* 3. There's also an issue for generic code -- some class Foo<T>
* might be allocated in context memory, and that might normally be
* fine, but if T is a ContextObj this requires certain care.
@@ -352,7 +353,7 @@ class ContextObj {
/**
* Pointer to Scope in which this object was last modified.
*/
- Scope* d_pScope;
+ Scope* d_pScope;
/**
* Pointer to most recent version of same ContextObj in a previous Scope
@@ -504,6 +505,7 @@ public:
* to be done using the restore method.
*/
static void* operator new(size_t size, ContextMemoryManager* pCMM) {
+ Trace("context_mm") << "Context::new " << size << " in " << pCMM << std::endl;
return pCMM->newData(size);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback