nim-chronos/chronos/streams
Jacek Sieka f03cdfcc40
futures: sinkify (#475)
This avoids copies here and there throughout the pipeline - ie
`copyString` and friends can often be avoided when moving things into
and out of futures

Annoyingly, one has to sprinkle the codebase liberally with `sink` and
`move` for the pipeline to work well - sink stuff _generally_ works
better in orc/arc

Looking at nim 1.6/refc, sink + local variable + move generates the best
code:

msg directly:
```nim
	T1_ = (*colonenv_).msg1; (*colonenv_).msg1 = copyStringRC1(msg);
```

local copy without move:
```nim
	T60_ = (*colonenv_).localCopy1; (*colonenv_).localCopy1 =
copyStringRC1(msg);
```

local copy with move:
```nim
	asgnRef((void**) (&(*colonenv_).localCopy1), msg);
```

Annoyingly, sink is also broken for refc+literals as it tries to
changes the refcount of the literal as part of the move (which shouldn't
be happening, but here we are), so we have to use a hack to find
literals and avoid moving them.
2023-11-19 18:29:09 +01:00
..
asyncstream.nim Asyncstreams asyncraises. (#472) 2023-11-17 23:18:09 +01:00
boundstream.nim Asyncstreams asyncraises. (#472) 2023-11-17 23:18:09 +01:00
chunkstream.nim Asyncstreams asyncraises. (#472) 2023-11-17 23:18:09 +01:00
tlsstream.nim futures: sinkify (#475) 2023-11-19 18:29:09 +01:00