summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/memorystore.cpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-26 03:15:09 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-26 03:15:09 -0800
commit0a9e019f082578895e4ebc88e4b89188da17947f (patch)
tree2a2017bec3d0450deb086fa6ad92d44b9e025e3b /starts/meaning-vm/level-0/memorystore.cpp
parentd5e8c913a0c3b63ef7eadea41ec1818548f5f4cf (diff)
downloadstandingwithresilience-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.cpp7
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);