Skip to content

Commit

Permalink
try to fix koch boot
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Jan 16, 2025
1 parent f8c396e commit b2cda7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2968,7 +2968,11 @@ when notJSnotNims and not defined(nimSeqsV2):
proc arrayWith*[T](y: T, size: static int): array[size, T] {.noinit, nodestroy, raises: [].} =
## Creates a new array filled with `y`.
for i in 0..size-1:
result[i] = `=dup`(y)
when (NimMajor, NimMinor, NimPatch) >= (2, 3, 1):
result[i] = `=dup`(y)
else:
wasMoved(result[i])
`=copy`(result[i], y)

proc arrayWithDefault*[T](size: static int): array[size, T] {.noinit, nodestroy, raises: [].} =
## Creates a new array filled with `default(T)`.
Expand Down
6 changes: 5 additions & 1 deletion lib/system/seqs_v2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ proc grow*[T](x: var seq[T]; newLen: Natural; value: T) {.nodestroy.} =
xu.p = cast[typeof(xu.p)](prepareSeqAddUninit(oldLen, xu.p, newLen - oldLen, sizeof(T), alignof(T)))
xu.len = newLen
for i in oldLen .. newLen-1:
xu.p.data[i] = `=dup`(value)
when (NimMajor, NimMinor, NimPatch) >= (2, 3, 1):
xu.p.data[i] = `=dup`(value)
else:
wasMoved(xu.p.data[i])
`=copy`(xu.p.data[i], value)

proc add*[T](x: var seq[T]; y: sink T) {.magic: "AppendSeqElem", noSideEffect, nodestroy.} =
## Generic proc for adding a data item `y` to a container `x`.
Expand Down

0 comments on commit b2cda7b

Please sign in to comment.