Files
Nim/compiler
Araq 8b597fc05f YRC: honour .acyclic instead of tracing acyclic data 'for correctness'
nimAsgnYrc/nimSinkYrc were emitted for EVERY ref type, ignoring .acyclic.
The barrier defers the dec into a stripe queue, drainStripe hands the cell
to registerLocal, and it enters the collector as a capture ROOT -- so types
annotated precisely to stay out of the cycle collector were traced by it
anyway, through capture/deadness/commit.

Gate that barrier on canFormAcycle (the same predicate ccgtypes.nim:1903
uses to set the descriptor's acyclic flag, so codegen and runtime cannot
disagree) and let acyclic refs fall through to the prompt arc-style path.
nimDecRefIsLastDyn stops forwarding to nimDecRefIsLastCyclicDyn and does a
prompt atomic dec.

No grace period is needed for those cells and that is not an accident: the
collector cannot reach one by traversal (liftdestructors only emits
nimTraceRef when isCyclic) and cannot hold one as a root (roots come only
from registerLocal on a drained dec). The queued dec was the only way in.
This also removes the reason for the earlier nimDecRefIsLastCyclicStatic
workaround for final acyclic types, so that is reverted.

compiler/astdef.nim now emits 97 nimDecRefIsLastDyn + 9 nimDecRefIsLast +
38 nimIncRef and zero nimAsgnYrc/nimDecRefIsLastCyclic*, matching ORC.

Compiler self-compile (--compileOnly compiler/nim.nim): 37.65s -> 6.99s,
against orc 6.96s and arc 6.77s. RSS 743MB vs orc 746MB. yrcbench is
unchanged (0.78s/5.13s CPU) and still passes its leak assertion, so cyclic
collection is unaffected. koch boot -d:release --mm:yrc reaches
'executables are equal: SUCCESS!'.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 18:24:25 +02:00
..
2026-07-03 15:52:41 +02:00
2023-12-15 10:20:57 +01:00
2025-12-01 22:59:12 +01:00
2026-07-03 15:52:41 +02:00
2026-06-11 14:10:42 +02:00
2026-02-10 13:21:35 +01:00
2026-06-14 22:35:06 +02:00
2026-06-14 22:35:06 +02:00
2026-06-25 23:20:34 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-14 22:35:06 +02:00
2026-06-25 23:20:34 +02:00
2026-06-14 22:35:06 +02:00
2025-12-31 13:33:57 +01:00
2026-02-10 13:21:35 +01:00
2026-06-14 22:35:06 +02:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-07-03 15:52:41 +02:00
2026-07-04 10:13:39 +02:00
2025-11-25 12:49:23 +01:00
2026-04-02 07:19:43 +02:00
2024-12-27 19:42:18 +01:00
2026-06-14 22:35:06 +02:00
2026-04-02 07:19:43 +02:00
2025-12-11 18:22:38 +01:00
2026-04-02 07:19:43 +02:00
2026-06-14 22:35:06 +02:00
2026-06-25 23:20:34 +02:00
2021-01-12 09:36:51 +01:00
2026-01-09 13:10:04 +01:00
2026-06-14 22:35:06 +02:00
2026-06-24 21:58:51 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-08 15:39:40 +02:00
2026-06-24 21:58:51 +02:00
2025-12-11 18:22:38 +01:00
2026-06-14 22:35:06 +02:00
2026-06-14 22:35:06 +02:00
2026-02-10 13:21:35 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2026-07-10 14:07:35 +02:00
2025-12-11 18:22:38 +01:00
2026-07-03 15:52:41 +02:00
2026-06-24 21:58:51 +02:00
2026-06-14 22:35:06 +02:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-07-03 15:52:41 +02:00
2026-06-14 22:35:06 +02:00
2024-03-16 08:35:18 +08:00
2026-06-24 21:58:51 +02:00
2026-06-25 23:20:34 +02:00
2025-12-31 13:33:57 +01:00
2026-07-04 10:13:39 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-14 22:35:06 +02:00
2023-12-25 07:12:54 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.