tinygo/testdata/channel.txt
Ayke van Laethem 9a54ee4241 compiler: allow larger-than-int values to be sent across a channel
Instead of storing the value to send/receive in the coroutine promise,
store only a pointer in the promise. This simplifies the code a lot and
allows larger value sizes to be sent across a channel.

Unfortunately, this new system has a code size impact. For example,
compiling testdata/channel.go for the BBC micro:bit, there is an
increase in code size from 4776 bytes to 4856 bytes. However, the
improved flexibility and simplicity of the code should be worth it. If
this becomes an issue, we can always refactor the code at a later time.
2019-05-05 16:46:50 +02:00

25 строки
388 Б
Text

len, cap of channel: 0 0
recv from open channel: 1 true
received num: 2
received num: 3
slept
received num: 4
received num: 5
received num: 6
received num: 7
received num: 8
recv from closed channel: 0 false
complex128: (+7.000000e+000+1.050000e+001i)
got n: 10
got n: 11
got n: 10
got n: 11
got n: 10
got n: 11
sum: 25
sum: 29
sum: 33
sum(100): 4950
deadlocking
select no-op
after no-op