about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-24 22:55:25 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-24 22:55:25 -0700
commit29a92072feab70aabf1602ec94b18d000ade93bc (patch)
tree39f1a5e51b54eb3e04a12fc27f268f537807266c
parent6d8ef6b12d37336a92c7a6b20b4b66f3ab424464 (diff)
downloadmu-29a92072feab70aabf1602ec94b18d000ade93bc.tar.gz
1190
-rw-r--r--cpp/042new.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/cpp/042new.cc b/cpp/042new.cc
index d268e6ca..01536689 100644
--- a/cpp/042new.cc
+++ b/cpp/042new.cc
@@ -12,12 +12,16 @@ recipe main [
 
 :(before "End Globals")
 size_t Memory_allocated_until = 1000;
+size_t Initial_memory_per_routine = 100000;
 :(before "End Setup")
 Memory_allocated_until = 1000;
+Initial_memory_per_routine = 100000;
 :(before "End routine Fields")
 size_t alloc;
 :(replace{} "routine::routine(recipe_number r)")
 routine::routine(recipe_number r) :alloc(Memory_allocated_until) {
+  alloc = Memory_allocated_until;
+  Memory_allocated_until += Initial_memory_per_routine;
   calls.push(call(r));
 }
 
@@ -117,10 +121,3 @@ recipe f2 [
   3:boolean <- equal 1:address:integer, 2:address:integer
 ]
 +mem: storing 0 in location 3
-
-:(before "End Globals")
-size_t Initial_memory_per_routine = 100000;
-:(before "End Setup")
-Initial_memory_per_routine = 100000;
-:(after "routine::routine(recipe_number r)")
-  Memory_allocated_until += Initial_memory_per_routine;