# valgrind client requests for undefined values · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/db74832e40f98960e5dc3e46c8196c59033ee0f9)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: db74832e40f98960e5dc3e46c8196c59033ee0f9

Requested commit: db74832e40f98960e5dc3e46c8196c59033ee0f9

Commit: db74832e40f98960e5dc3e46c8196c59033ee0f9

Tree: 95d7e039968d665d0e0001c45c9c9c1f3e2a622d

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
valgrind client requests for undefined values

with this change, when you assign undefined, zig emits a few
assembly instructions to tell valgrind that the memory is undefined

it's on by default for debug builds, and disabled otherwise. only
support for linux, darwin, solaris, mingw on x86_64 is currently
implemented.

--disable-valgrind turns it off even in debug mode.
--enable-valgrind turns it on even in release modes.

It's always disabled for compiler_rt.a and builtin.a.

Adds `@import("builtin").valgrind_support` which lets code know
at comptime whether valgrind client requests are enabled.

See #1989

```

## Parents

- [c9fb5240d6305bcef7db5e12b7676ba3d741c11e](https://git.cafe/gitcafe/zig/commit/c9fb5240d6305bcef7db5e12b7676ba3d741c11e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/db74832e40f98960e5dc3e46c8196c59033ee0f9?format=markdown)
