summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/mmdisp.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim
index 2c9b1e502..b33ca93f2 100644
--- a/lib/system/mmdisp.nim
+++ b/lib/system/mmdisp.nim
@@ -562,7 +562,8 @@ else:
 when not declared(nimNewSeqOfCap):
   proc nimNewSeqOfCap(typ: PNimType, cap: int): pointer {.compilerproc.} =
     when defined(gcRegions):
-      result = newStr(typ, cap, ntfNoRefs notin typ.base.flags)
+      let s = mulInt(cap, typ.base.size)  # newStr already adds GenericSeqSize
+      result = newStr(typ, s, ntfNoRefs notin typ.base.flags)
     else:
       let s = addInt(mulInt(cap, typ.base.size), GenericSeqSize)
       when declared(newObjNoInit):