From fa0c006672437f4e89f86d0f53e9e4b3da767a74 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 15 Mar 2015 08:51:53 -0700 Subject: 927 --- cpp/012run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpp/012run') diff --git a/cpp/012run b/cpp/012run index 03bb2be4..3f02c7b9 100644 --- a/cpp/012run +++ b/cpp/012run @@ -19,7 +19,7 @@ recipe main [ :(before "End Types") // Each recipe can be 'called' many many times in a program. Each call needs a -// little extra information. +// little extra information. TODO: move this into the call layer somehow struct call { recipe_number running_recipe; size_t pc; @@ -28,6 +28,7 @@ struct call { }; typedef stack call_stack; +// TODO: move this into the scheduler layer somehow struct routine { size_t alloc; size_t alloc_max; @@ -51,6 +52,7 @@ void run(recipe_number r) { void run(routine rr) { while (!rr.calls.empty()) { vector& instructions = Recipe[rr.calls.top().running_recipe].steps; + // TODO: move this into the call layer somehow while (rr.calls.top().pc >= instructions.size()) { rr.calls.pop(); if (rr.calls.empty()) return; -- cgit 1.4.1-2-gfad0