summary refs log tree commit diff stats
path: root/lib/core
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-10-28 13:00:49 +0000
committerGitHub <noreply@github.com>2020-10-28 14:00:49 +0100
commit0956a9953780b0952acb56806fdffa8054fe1070 (patch)
treefaa6c34f39a54726477c2d4e983df05e681a927d /lib/core
parent732ddc02da9b6203e402d246078827d525434e6b (diff)
downloadNim-0956a9953780b0952acb56806fdffa8054fe1070.tar.gz
ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697)
Diffstat (limited to 'lib/core')
-rw-r--r--lib/core/typeinfo.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim
index 9fd8ebf8c..5c4e1b601 100644
--- a/lib/core/typeinfo.nim
+++ b/lib/core/typeinfo.nim
@@ -108,7 +108,7 @@ when not defined(gcDestructors):
   proc newSeq(typ: PNimType, len: int): pointer {.importCompilerProc.}
   proc objectInit(dest: pointer, typ: PNimType) {.importCompilerProc.}
 else:
-  proc nimNewObj(size: int): pointer {.importCompilerProc.}
+  proc nimNewObj(size, align: int): pointer {.importCompilerProc.}
   proc newSeqPayload(cap, elemSize, elemAlign: int): pointer {.importCompilerProc.}
   proc prepareSeqAdd(len: int; p: pointer; addlen, elemSize, elemAlign: int): pointer {.
     importCompilerProc.}
@@ -178,7 +178,7 @@ proc invokeNew*(x: Any) =
   ## performs ``new(x)``. `x` needs to represent a ``ref``.
   assert x.rawType.kind == tyRef
   when defined(gcDestructors):
-    cast[ppointer](x.value)[] = nimNewObj(x.rawType.base.size)
+    cast[ppointer](x.value)[] = nimNewObj(x.rawType.base.size, x.rawType.base.align)
   else:
     var z = newObj(x.rawType, x.rawType.base.size)
     genericAssign(x.value, addr(z), x.rawType)