diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-26 03:15:09 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-26 03:15:09 -0800 |
commit | 0a9e019f082578895e4ebc88e4b89188da17947f (patch) | |
tree | 2a2017bec3d0450deb086fa6ad92d44b9e025e3b /starts/meaning-vm/level-0/memorystore.cpp | |
parent | d5e8c913a0c3b63ef7eadea41ec1818548f5f4cf (diff) | |
download | standingwithresilience-0a9e019f082578895e4ebc88e4b89188da17947f.tar.gz standingwithresilience-0a9e019f082578895e4ebc88e4b89188da17947f.zip |
removed braces from multilink call, normalized memorystore ref usage per proposal
Diffstat (limited to 'starts/meaning-vm/level-0/memorystore.cpp')
-rw-r--r-- | starts/meaning-vm/level-0/memorystore.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/starts/meaning-vm/level-0/memorystore.cpp b/starts/meaning-vm/level-0/memorystore.cpp index d3e4f95..b092ca0 100644 --- a/starts/meaning-vm/level-0/memorystore.cpp +++ b/starts/meaning-vm/level-0/memorystore.cpp @@ -1,6 +1,7 @@ #include "memorystore.hpp" #include "concept.hpp" #include "errors.hpp" +#include "ref.hpp" #include <unordered_set> @@ -9,11 +10,11 @@ namespace level0 { static auto & concepts() { - static std::unordered_set<concept*, std::hash<concept*>> concepts; + static std::unordered_set<ref, std::hash<concept*>> concepts; return concepts; } -concept* alloc(concept * moved) { +ref alloc(concept * moved) { ref r = moved ? moved : new concept(); concepts().insert(r); return r; @@ -36,7 +37,7 @@ static concept* referenced(ref r) { return 0; } -void dealloc(concept * r) { +void dealloc(ref r) { concept * referenced = intellect::level0::referenced(r); if (referenced) { throw still_referenced_by(r, referenced); |