diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 08:42:45 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 08:42:45 -0800 |
commit | 684ac69af192670bb6547ec01df19a3159e7d8e6 (patch) | |
tree | e6c6762e9fc40cf0ad557e160e9ab6ba7bb99eea /starts/meaning-vm/level-0/memorystore.cpp | |
parent | 520119a6f6ed418b8ae45bfde8239bbb532562cd (diff) | |
download | standingwithresilience-684ac69af192670bb6547ec01df19a3159e7d8e6.tar.gz standingwithresilience-684ac69af192670bb6547ec01df19a3159e7d8e6.zip |
separate functionality out a bit
Diffstat (limited to 'starts/meaning-vm/level-0/memorystore.cpp')
-rw-r--r-- | starts/meaning-vm/level-0/memorystore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/starts/meaning-vm/level-0/memorystore.cpp b/starts/meaning-vm/level-0/memorystore.cpp index 7018418..d3e4f95 100644 --- a/starts/meaning-vm/level-0/memorystore.cpp +++ b/starts/meaning-vm/level-0/memorystore.cpp @@ -9,11 +9,11 @@ namespace level0 { static auto & concepts() { - static std::unordered_set<ref, std::hash<concept*>> concepts; + static std::unordered_set<concept*, std::hash<concept*>> concepts; return concepts; } -ref alloc(concept * moved) { +concept* alloc(concept * moved) { ref r = moved ? moved : new concept(); concepts().insert(r); return r; @@ -36,7 +36,7 @@ static concept* referenced(ref r) { return 0; } -void dealloc(ref r) { +void dealloc(concept * r) { concept * referenced = intellect::level0::referenced(r); if (referenced) { throw still_referenced_by(r, referenced); @@ -46,7 +46,7 @@ void dealloc(ref r) { it != concepts().end(); ++ it) { - if (ref(*it) == r) { + if (*it == r) { concepts().erase(it); delete (concept*)r; return; |