about summary refs log tree commit diff stats
path: root/072scheduler.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-17 12:55:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-17 12:55:10 -0700
commit760f683f2755038a1b0c16522f5001b889096aa5 (patch)
treee07afd384d45be93d81fb4c1788b332fe05799a0 /072scheduler.cc
parent80df524b566a708551f752ce8b82e21738591651 (diff)
downloadmu-760f683f2755038a1b0c16522f5001b889096aa5.tar.gz
3389
Diffstat (limited to '072scheduler.cc')
-rw-r--r--072scheduler.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/072scheduler.cc b/072scheduler.cc
index 30f986a2..232fa0e5 100644
--- a/072scheduler.cc
+++ b/072scheduler.cc
@@ -253,12 +253,12 @@ def main [
 ]
 def create-new-routine [
   local-scope
-  n:address:num <- new number:type
+  n:&:num <- new number:type
   *n <- copy 34
   start-running new-routine, n
   # refcount of n decremented
 ]
-def new-routine n:address:num [
+def new-routine n:&:num [
   local-scope
   load-ingredients
   1:num/raw <- copy *n
@@ -281,24 +281,24 @@ if (inst.operation == NEXT_INGREDIENT || inst.operation == NEXT_INGREDIENT_WITHO
 }
 
 :(scenario next_ingredient_never_leaks_refcounts)
-def create-scope n:address:num -> default-space:address:array:location [
+def create-scope n:&:num -> default-space:&:array:location [
   default-space <- new location:type, 2
   load-ingredients
 ]
 def use-scope [
   local-scope
-  0:address:array:location/names:create-scope <- next-ingredient
-  n:address:num/space:1 <- next-ingredient  # should decrement refcount
+  0:&:array:location/names:create-scope <- next-ingredient
+  n:&:num/space:1 <- next-ingredient  # should decrement refcount
   *n/space:1 <- copy 34
   n2:num <- add *n/space:1, 1
   reply n2
 ]
 def main [
   local-scope
-  n:address:num <- copy 12000/unsafe  # pretend allocation with a known address
+  n:&:num <- copy 12000/unsafe  # pretend allocation with a known address
   *n <- copy 23
-  scope:address:array:location <- create-scope n
-  n2:address:num <- copy 13000/unsafe
+  scope:&:array:location <- create-scope n
+  n2:&:num <- copy 13000/unsafe
   n3:num <- use-scope scope, n2
 ]
 +run: {n: ("address" "number"), "space": "1"} <- next-ingredient
@@ -664,16 +664,16 @@ def f2 [
 :(scenario new_concurrent)
 def f1 [
   start-running f2
-  1:address:num/raw <- new number:type
+  1:&:num/raw <- new number:type
   # wait for f2 to complete
   {
     loop-unless 4:num/raw
   }
 ]
 def f2 [
-  2:address:num/raw <- new number:type
+  2:&:num/raw <- new number:type
   # hack: assumes scheduler implementation
-  3:bool/raw <- equal 1:address:num/raw, 2:address:num/raw
+  3:bool/raw <- equal 1:&:num/raw, 2:&:num/raw
   # signal f2 complete
   4:num/raw <- copy 1
 ]