From cdf2822743b3beeb37ebc3deea8e08b6130698c5 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 12 May 2018 10:22:26 -0700 Subject: 4242 - get rid of refcounts entirely We're going to lean back into the experiment of commit 4179 back in Jan. If we delete memory it's up to us to ensure no pointers into it survive. Since deep-copy depends on our refcounting infrastructure, it's gone as well. So we're going to have to start watching out for pointers shared over channels. --- html/channel.mu.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'html/channel.mu.html') diff --git a/html/channel.mu.html b/html/channel.mu.html index f69af8e5..fdb5c2dc 100644 --- a/html/channel.mu.html +++ b/html/channel.mu.html @@ -59,7 +59,7 @@ if ('onhashchange' in window) {
  1 # example program: communicating between routines using channels
  2 
- 3 def producer sink:&:sink:char -> sink:&:sink:char [
+ 3 def producer sink:&:sink:char -> sink:&:sink:char [
  4   # produce characters 1 to 5 on a channel
  5   local-scope
  6   load-inputs
@@ -71,20 +71,20 @@ if ('onhashchange' in window) {
 12     # other threads might get between these prints
 13     $print [produce: ], n, [ 
 14 ]
-15     sink <- write sink, n
+15     sink <- write sink, n
 16     n <- add n, 1
 17     loop
 18   }
-19   close sink
+19   close sink
 20 ]
 21 
-22 def consumer source:&:source:char -> source:&:source:char [
+22 def consumer source:&:source:char -> source:&:source:char [
 23   # consume and print integers from a channel
 24   local-scope
 25   load-inputs
 26   {
 27     # read an integer from the channel
-28     n:char, eof?:bool, source <- read source
+28     n:char, eof?:bool, source <- read source
 29     break-if eof?
 30     # other threads might get between these prints
 31     $print [consume: ], n:char, [ 
@@ -95,10 +95,10 @@ if ('onhashchange' in window) {
 36 
 37 def main [
 38   local-scope
-39   source:&:source:char, sink:&:sink:char <- new-channel 3/capacity
+39   source:&:source:char, sink:&:sink:char <- new-channel 3/capacity
 40   # create two background 'routines' that communicate by a channel
-41   routine1:num <- start-running producer, sink
-42   routine2:num <- start-running consumer, source
+41   routine1:num <- start-running producer, sink
+42   routine2:num <- start-running consumer, source
 43   wait-for-routine routine1
 44   wait-for-routine routine2
 45 ]
-- 
cgit 1.4.1-2-gfad0