diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-09 20:38:22 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-09 20:38:22 -0800 |
commit | 1b8c47a8b14f784f6605eee3a73713dbce6ca572 (patch) | |
tree | 9b7034b5e148ee8b0f9fbe0c6e89d7f9a656a27e /starts/meaning-vm/level0.cpp | |
parent | 3e3aeddec840fed915b0fa748dcd2f56d6f682ef (diff) | |
download | standingwithresilience-1b8c47a8b14f784f6605eee3a73713dbce6ca572.tar.gz standingwithresilience-1b8c47a8b14f784f6605eee3a73713dbce6ca572.zip |
changed level-0 allocation to use groups
Diffstat (limited to 'starts/meaning-vm/level0.cpp')
-rw-r--r-- | starts/meaning-vm/level0.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/starts/meaning-vm/level0.cpp b/starts/meaning-vm/level0.cpp index 6ff0102..86ce0cd 100644 --- a/starts/meaning-vm/level0.cpp +++ b/starts/meaning-vm/level0.cpp @@ -5,17 +5,21 @@ 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(); + 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 +41,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; |