diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-05-15 23:08:47 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-05-15 23:08:47 +0000 |
commit | 8d5161bf33528459447ee1ca02006ec0252db196 (patch) | |
tree | e618608535597cfadc56255eec9e099b47bd3921 /src/piraha/smart_ptr.hpp | |
parent | 0bad3f039d9734b99f43b36215e1dae482eae9a9 (diff) |
Move all of Piraha into cctki_piraha namespace
Change namespace "piraha" to "cctki_piraha", as per Cactus naming
standard.
Move smart_ptr into this namespace as well.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@5012 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/piraha/smart_ptr.hpp')
-rw-r--r-- | src/piraha/smart_ptr.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/piraha/smart_ptr.hpp b/src/piraha/smart_ptr.hpp index 58555562..b8784b55 100644 --- a/src/piraha/smart_ptr.hpp +++ b/src/piraha/smart_ptr.hpp @@ -8,6 +8,8 @@ #define NULL ((void*)0) #endif +namespace cctki_piraha { + extern std::set<void*> *ptrs; // TODO: This code is disabled because it leads to segfaults during @@ -19,11 +21,15 @@ extern std::set<void*> *ptrs; inline void add(std::set<void*>& v,void *t) { if(t == NULL) return; + // TODO: Don't separate finding and inserting; do it in one go to + // save a lookup. assert(v.find(t) == v.end()); v.insert(t); } inline void remove(std::set<void*>& v,void* t) { + // TODO: Don't separate finding and erasing; do it in one go + // to save a lookup. std::set<void*>::iterator it = v.find(t); assert(it != v.end()); v.erase(it); @@ -163,4 +169,6 @@ class smart_ptr { template<typename C> friend class smart_ptr; }; + +} #endif |