summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level0.cpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-10 06:56:07 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-10 06:56:07 -0800
commit3a054408336ab5754a9da6050bf31110f2211c89 (patch)
treeb58d22733d2ee50a24942bb6e06786d7a84ea9ce /starts/meaning-vm/level0.cpp
parent971852c322523145f44bf384bebb82870a99708d (diff)
parentd84b81bc12e6a22e442d5dce38e59222119311f0 (diff)
downloadstandingwithresilience-3a054408336ab5754a9da6050bf31110f2211c89.tar.gz
standingwithresilience-3a054408336ab5754a9da6050bf31110f2211c89.zip
Merge branch 'wip'
Diffstat (limited to 'starts/meaning-vm/level0.cpp')
-rw-r--r--starts/meaning-vm/level0.cpp38
1 files changed, 17 insertions, 21 deletions
diff --git a/starts/meaning-vm/level0.cpp b/starts/meaning-vm/level0.cpp
index 6ff0102..4ab8b7b 100644
--- a/starts/meaning-vm/level0.cpp
+++ b/starts/meaning-vm/level0.cpp
@@ -5,17 +5,23 @@
using namespace intellect::level0;
+#define out(name) std::cout << " " #name ":" << (long)name.ptr()
+
int main()
{
- ref a = alloc();
- ref b = alloc();
- ref c = alloc();
- ref d = alloc();
- ref e = alloc();
- auto numlink = alloc();
- auto codelink = alloc();
-
- ref skip = alloc();
+ std::cout << allocated() << " allocated" << std::endl;
+
+ ref store = alloc(concepts::allocations()); out(store);
+ ref a = alloc(store); out(a);
+ ref b = alloc(store); out(b);
+ ref c = alloc(store); out(c);
+ ref d = alloc(store); out(d);
+ ref e = alloc(store); out(e);
+ auto numlink = alloc(a); out(numlink);
+ auto codelink = alloc(a); out(codelink);
+
+ ref skip = alloc(store); out(skip);
+ std::cout << std::endl;
a.link(
b, c,
@@ -37,18 +43,8 @@ int main()
std::cout << allocated() << " allocated" << std::endl;
e.unlink(b, a);
- auto num = a.get(numlink);
- auto code = a.get(codelink);
- dealloc(a);
- dealloc(num);
- dealloc(code);
- dealloc(numlink);
- dealloc(codelink);
- dealloc(c);
- dealloc(e);
- dealloc(b);
- dealloc(d);
- dealloc(skip);
+ //dealloc(a, store);
+ dealloc(store, concepts::allocations());
std::cout << allocated() << " allocated" << std::endl;