make `isLiteral` compatible with ARC and ORC (#602)
(cherry picked from commit 2d4dad07165cd53e3e81af0dffb462609a93e555)
This commit is contained in:
parent
26e47d7da5
commit
c12f00c8b6
|
@ -37,10 +37,13 @@ proc len*(vb: VBuffer): int =
|
|||
doAssert(result >= 0)
|
||||
|
||||
proc isLiteral[T](s: seq[T]): bool {.inline.} =
|
||||
type
|
||||
SeqHeader = object
|
||||
length, reserved: int
|
||||
(cast[ptr SeqHeader](s).reserved and (1 shl (sizeof(int) * 8 - 2))) != 0
|
||||
when defined(gcOrc) or defined(gcArc):
|
||||
false
|
||||
else:
|
||||
type
|
||||
SeqHeader = object
|
||||
length, reserved: int
|
||||
(cast[ptr SeqHeader](s).reserved and (1 shl (sizeof(int) * 8 - 2))) != 0
|
||||
|
||||
proc initVBuffer*(data: seq[byte], offset = 0): VBuffer =
|
||||
## Initialize VBuffer with shallow copy of ``data``.
|
||||
|
|
Loading…
Reference in New Issue