gc:destructors further progress

This commit is contained in:
Andreas Rumpf 2018-11-29 01:13:24 +01:00
commit 7d82df20be
6 changed files with 52 additions and 24 deletions

View file

@ -85,7 +85,7 @@ type
proc newSeqPayload(cap, elemSize: int): pointer {.compilerRtl.} =
# we have to use type erasure here as Nim does not support generic
# compilerProcs. Oh well, this will all be inlined anyway.
if cap <= 0:
if cap > 0:
let region = getLocalAllocator()
var p = cast[ptr PayloadBase](region.alloc(region, cap * elemSize + sizeof(int) + sizeof(Allocator)))
p.region = region