Files
Nim/compiler
heterodoxic 318b2cfc5e allow having {.noinit.} on a complex type avoid memsets to 0 for its … (#23388)
…instantiations (C/C++ backend)

AFAIK, #22802 expanded `noinit`'s utility by allowing the pragma to be
attached to types (thanks @jmgomez !).
I suggest broadening the scope a bit further: try to avoid `nimZeroMem`s
on a type level beyond imported C/C++ types[^1], saving us from
annotating the type instantiations with `noinit`.

If this change is deemed acceptable, I will also adjust the docs, of
course.

Adding tests for this change seems a bit problematic, as the effect of
this type annotation will be to work with uninitialized memory, which
*might* match 0 patterns.

[^1]: "complex value types" as already defined here:
94c5996877/compiler/cgen.nim (L470-L471)
2024-04-18 21:58:01 +02:00
..
2023-12-15 10:20:57 +01:00
2023-12-17 18:43:52 +01:00
2022-09-27 10:57:47 +02:00
2023-12-15 10:20:57 +01:00
2024-03-16 08:35:18 +08:00
2024-03-16 08:35:18 +08:00
2017-01-07 22:35:09 +01:00
2023-12-15 10:20:57 +01:00
2023-12-17 18:43:52 +01:00
2024-04-18 21:53:27 +02:00
2023-12-13 10:29:58 +01:00
2023-11-04 17:46:59 +08:00
2021-01-12 09:36:51 +01:00
2022-03-23 20:34:53 +01:00
2023-12-17 18:43:52 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2024-03-16 08:35:18 +08:00
2023-12-13 10:29:58 +01:00
2023-12-15 10:20:57 +01:00
2023-12-17 18:43:52 +01: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.