summary refs log tree commit diff stats
path: root/compiler/isolation_check.nim
diff options
context:
space:
mode:
authorheterodoxic <122719743+heterodoxic@users.noreply.github.com>2024-04-18 21:58:01 +0200
committerGitHub <noreply@github.com>2024-04-18 21:58:01 +0200
commit318b2cfc5ebeee5e27982bb5a76fa4c00d523772 (patch)
tree91162b88c34c993b1d0afab0832a1a619597c1bc /compiler/isolation_check.nim
parent558bbb7426b21156b6ad5f8834a62cdf067a2ac3 (diff)
downloadNim-318b2cfc5ebeee5e27982bb5a76fa4c00d523772.tar.gz
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:
https://github.com/nim-lang/Nim/blob/94c599687796f4ee3872c8aa866827b9ed33f52b/compiler/cgen.nim#L470-L471
Diffstat (limited to 'compiler/isolation_check.nim')
0 files changed, 0 insertions, 0 deletions