summary refs log tree commit diff stats
path: root/lib/system/mmdisp.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2020-04-19 07:52:01 +0200
committerGitHub <noreply@github.com>2020-04-19 07:52:01 +0200
commit4005f0d0e40fb57efd8144c065a7ba56d940b572 (patch)
tree7df2d805351ed3c72114d00c773ff7d581337eda /lib/system/mmdisp.nim
parenta8f030fea21894e51c188a5804b0bbf787335f4d (diff)
downloadNim-4005f0d0e40fb57efd8144c065a7ba56d940b572.tar.gz
forward type alignment information to seqs (#12430)
Diffstat (limited to 'lib/system/mmdisp.nim')
-rw-r--r--lib/system/mmdisp.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim
index 2c3394df9..1cdf37604 100644
--- a/lib/system/mmdisp.nim
+++ b/lib/system/mmdisp.nim
@@ -46,7 +46,7 @@ const
   PageSize = 1 shl PageShift
   PageMask = PageSize-1
 
-  MemAlign = 8 # also minimal allocatable memory block
+  MemAlign = 16 # also minimal allocatable memory block
 
   BitsPerPage = PageSize div MemAlign
   UnitsPerPage = BitsPerPage div (sizeof(int)*8)
@@ -108,7 +108,7 @@ when not declared(nimNewSeqOfCap) and not defined(nimSeqsV2):
       let s = cap * typ.base.size  # newStr already adds GenericSeqSize
       result = newStr(typ, s, ntfNoRefs notin typ.base.flags)
     else:
-      let s = cap * typ.base.size + GenericSeqSize
+      let s = align(GenericSeqSize, typ.base.align) + cap * typ.base.size
       when declared(newObjNoInit):
         result = if ntfNoRefs in typ.base.flags: newObjNoInit(typ, s) else: newObj(typ, s)
       else: