nim-chronos icon indicating copy to clipboard operation
nim-chronos copied to clipboard

deal with seq[T] casting to ptr SeqHeader with --gc:arc

Open gogolxdong opened this issue 3 years ago • 3 comments

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

gogolxdong avatar Sep 07 '20 09:09 gogolxdong

We aren't supporting the ARC gc ATM.

dryajov avatar Sep 07 '20 14:09 dryajov

When will arc/orc be supported?

gogolxdong avatar Sep 09 '20 13:09 gogolxdong

ATM, we're sticking with the smallest stable feature subset in Nim and unfortunately ARC/ORC aren't 100% stable.

dryajov avatar Sep 09 '20 14:09 dryajov