forward type alignment information to seqs (#12430)

This commit is contained in:
Arne Döring 2020-04-19 07:52:01 +02:00 • committed by GitHub
commit 4005f0d0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 152 additions and 114 deletions

View file

@ -21,7 +21,7 @@ proc newObjNoInit(typ: PNimType, size: int): pointer =
{.push overflowChecks: on.}
proc newSeq(typ: PNimType, len: int): pointer {.compilerproc.} =
result = newObj(typ, len * typ.base.size + GenericSeqSize)
result = newObj(typ, align(GenericSeqSize, typ.align) + len * typ.base.size)
cast[PGenericSeq](result).len = len
cast[PGenericSeq](result).reserved = len
{.pop.}