diff options
author | heterodoxic <122719743+heterodoxic@users.noreply.github.com> | 2024-04-18 21:58:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 21:58:01 +0200 |
commit | 318b2cfc5ebeee5e27982bb5a76fa4c00d523772 (patch) | |
tree | 91162b88c34c993b1d0afab0832a1a619597c1bc /compiler/semgnrc.nim | |
parent | 558bbb7426b21156b6ad5f8834a62cdf067a2ac3 (diff) | |
download | Nim-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/semgnrc.nim')
0 files changed, 0 insertions, 0 deletions