diff --git a/koch.nim b/koch.nim index a9f5637fd4195..628c810989595 100644 --- a/koch.nim +++ b/koch.nim @@ -542,9 +542,7 @@ proc runCI(cmd: string) = #[ BUG: with initOptParser, `--batch:'' all` interprets `all` as the argument of --batch ]# - # execFold("Run tester", "nim c -r -d:nimCoroutines testament/testament --pedantic --batch:$1 all -d:nimCoroutines" % ["NIM_TESTAMENT_BATCH".getEnv("_")]) - execFold("Run tester", "nim c -r -d:nimCoroutines testament/testament --pedantic --batch:$1 pcat dll" % ["NIM_TESTAMENT_BATCH".getEnv("_")]) - doAssert false, "PRTEMP" + execFold("Run tester", "nim c -r -d:nimCoroutines testament/testament --pedantic --batch:$1 all -d:nimCoroutines" % ["NIM_TESTAMENT_BATCH".getEnv("_")]) block CT_FFI: when defined(posix): # windows can be handled in future PR's diff --git a/lib/pure/reservedmem.nim b/lib/pure/reservedmem.nim index 82d5898086797..469ca7efaa24e 100644 --- a/lib/pure/reservedmem.nim +++ b/lib/pure/reservedmem.nim @@ -92,8 +92,7 @@ else: memRead* = MemAccessFlags(PROT_READ) memReadWrite* = MemAccessFlags(PROT_READ or PROT_WRITE) - # template check(expr) = - proc check(expr: auto) = + template check(expr) = if not expr: raiseOSError(osLastError()) @@ -180,14 +179,8 @@ proc setLen*(m: var ReservedMem, newLen: int) = when defined(windows): check virtualFree(newCommitEnd, commitSizeShrinkage, MEM_DECOMMIT) else: - when not defined(openbsd): - check posix_madvise(newCommitEnd, commitSizeShrinkage, - POSIX_MADV_DONTNEED) == 0 - else: - # xxx figure out what to do here; options are doing nothing, and - # calling `madvise`; note that `MADV_DONTNEED` can differ from - # `POSIX_MADV_DONTNEED`; refs: https://man7.org/linux/man-pages/man3/posix_madvise.3.html - discard + check posix_madvise(newCommitEnd, commitSizeShrinkage, + POSIX_MADV_DONTNEED) == 0 m.committedMemEnd = newCommitEnd diff --git a/tests/dll/nimhcr_integration.nim b/tests/dll/nimhcr_integration.nim index eda130005547b..58851b5c4cf2d 100644 --- a/tests/dll/nimhcr_integration.nim +++ b/tests/dll/nimhcr_integration.nim @@ -1,4 +1,5 @@ discard """ + disabled: "openbsd" output: ''' main: HELLO! main: hasAnyModuleChanged? true @@ -64,8 +65,7 @@ xxx disabled: "openbsd" because it would otherwise give: /home/build/Nim/lib/pure/includes/oserr.nim(94) raiseOSError Error: unhandled exception: Not supported [OSError] -The stacktrace actually points to either of these failing: -`check mprotect` or `check posix_madvise` +After instrumenting code, the stacktrace actually points to the call to `check mprotect` ]# ## This is perhaps the most complex test in the nim test suite - calling the