You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
procfff(v: sinkstring): iterator(): char=returniterator(): char=for c in v:
yield c
var tmp =newString(100*1024*1024)
let iter =fff(move(tmp))
var i =0whiletrue:
let v =iter()
iffinished(iter):
break
i+=1discardecho i
echoGC_getStatistics()
The above program should take no more than 100mb + some dust - ie the v parameter clearly can be moved into the iterator but isn't.
The copy happens during environment construction here:
Notably, this only affects refc - devel detects the sink parameter and moves the instance correctly.
This issue in particular can be seen with the {.async.} transformation for both std and chronos - solving it would cut memory usage in something like #13923 by half, most probably.
Nim Version
1.6.12, devel (refc)
Current Output
No response
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Description
The above program should take no more than 100mb + some dust - ie the
v
parameter clearly can be moved into the iterator but isn't.The copy happens during environment construction here:
Notably, this only affects
refc
-devel
detects the sink parameter and moves the instance correctly.This issue in particular can be seen with the
{.async.}
transformation for both std and chronos - solving it would cut memory usage in something like #13923 by half, most probably.Nim Version
1.6.12, devel (refc)
Current Output
No response
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: