From 0a9e019f082578895e4ebc88e4b89188da17947f Mon Sep 17 00:00:00 2001 From: olpc user Date: Tue, 26 Nov 2019 03:15:09 -0800 Subject: removed braces from multilink call, normalized memorystore ref usage per proposal --- starts/meaning-vm/level-0/memorystore.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'starts/meaning-vm/level-0/memorystore.cpp') 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 @@ -9,11 +10,11 @@ namespace level0 { static auto & concepts() { - static std::unordered_set> concepts; + static std::unordered_set> 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); -- cgit v1.2.3