nim-chronos/chronos/internal
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
..
asyncengine.nim move docs to docs (#466) 2023-11-15 09:06:37 +01:00
asyncfutures.nim futures: sinkify (#475) 2023-11-19 18:29:09 +01:00
asyncmacro.nim futures: sinkify (#475) 2023-11-19 18:29:09 +01:00
errors.nim per-function `Exception` handling (#457) 2023-11-08 15:12:32 +01:00
raisesfutures.nim introduce asyncraises in transports/asyncsync (#470) 2023-11-15 09:38:48 +01:00