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
thor Kartik K. Agaram <vc@akkartik.com> 2016-03-13 20:26:47 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2016-03-13 20:26:47 -0700 2773 - switch to 'int'' href='/akkartik/mu/commit/038location_array.cc?h=main&id=b24eb4766ad12eceaafa2ee0d620e070e21a3293'>b24eb476 ^
f40137f1 ^
8d82da3c ^
b24eb476 ^
8d82da3c ^






6c96a437 ^
8d82da3c ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46