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
unless we can guarantee that existing code in toSeq produces the most efficient code in release, we should make toSeq should use copyMem when possible
example
import std/sequtils
typeFoo=object
f0: seq[int]
procfn(a1: openArray[int])=var a2 = [1,2]
var a3 =@[1,2]
# var f = Foo(f0: a1) # Error: type mismatch:# var f = Foo(f0: a2) # ditto# var s = a1 # ditto# var f = Foo(f0: a3) # ookvar s = a1.toSeq # works but via a for-loop (currently); toSeq should use copyMem when possiblefn([1,2])
notes
ideally, copyMem could have a safer wrapper that can be reused (with no performance penalty)
(maybe in strbasics? or rename this module since lots of low-level procs are similar for seq/string?)
unless we can guarantee that existing code in toSeq produces the most efficient code in release, we should make
toSeq
should usecopyMem
when possibleexample
notes
ideally,
copyMem
could have a safer wrapper that can be reused (with no performance penalty)(maybe in strbasics? or rename this module since lots of low-level procs are similar for seq/string?)
links
The text was updated successfully, but these errors were encountered: