From 8d5161bf33528459447ee1ca02006ec0252db196 Mon Sep 17 00:00:00 2001 From: eschnett Date: Wed, 15 May 2013 23:08:47 +0000 Subject: 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 --- src/piraha/smart_ptr.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/piraha/smart_ptr.hpp') 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 *ptrs; // TODO: This code is disabled because it leads to segfaults during @@ -19,11 +21,15 @@ extern std::set *ptrs; inline void add(std::set& 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& v,void* t) { + // TODO: Don't separate finding and erasing; do it in one go + // to save a lookup. std::set::iterator it = v.find(t); assert(it != v.end()); v.erase(it); @@ -163,4 +169,6 @@ class smart_ptr { template friend class smart_ptr; }; + +} #endif -- cgit v1.2.3