From 889e4b958e0755eb18f4d545ba4f191d9ea0296c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 19 Aug 2014 12:02:40 -0700 Subject: 53 - simplest possible allocator: just one word at a time But with tests this time. --- new.arc.t | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 new.arc.t (limited to 'new.arc.t') diff --git a/new.arc.t b/new.arc.t new file mode 100644 index 00000000..e256ea86 --- /dev/null +++ b/new.arc.t @@ -0,0 +1,19 @@ +(load "mu.arc") +(load "new.arc") + +(reset) +(add-fns + '((main))) +(run function*!main) +(if (~iso memory* (obj Root_allocator_pointer 1000)) + (prn "F - allocator initialized")) + +(reset) +(add-fns + '((main + ((x integer-address) <- new) + ((x integer-address deref) <- literal 34)))) +(run function*!main) +;? (prn memory*) +(if (~iso memory*!Root_allocator_pointer 1001) + (prn "F - 'new' increments allocator pointer")) -- cgit 1.4.1-2-gfad0