nim-chronos
nim-chronos copied to clipboard
deal with seq[T] casting to ptr SeqHeader with --gc:arc
type
SeqHeader = object
length, reserved: int
proc isLiteral*(s: string): bool {.inline.} =
(cast[ptr SeqHeader](s.cstring).reserved and (1 shl (sizeof(int) * 8 - 2))) != 0
proc isLiteral*[T](s: seq[T]): bool {.inline.} =
(cast[ptr SeqHeader](s).reserved and (1 shl (sizeof(int) * 8 - 2))) != 0
How to deal with seq[T] casting to ptr SeqHeader with --gc:arc
We aren't supporting the ARC gc ATM.
When will arc/orc be supported?
ATM, we're sticking with the smallest stable feature subset in Nim and unfortunately ARC/ORC aren't 100% stable.