# optimize \`@memset\` with \`undefined\` · gitcafe/zig

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

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

Visibility: public

Requested revision: 3552180143a86432bfec3e71ba2fdd7aaebb0549

Requested commit: 3552180143a86432bfec3e71ba2fdd7aaebb0549

Commit: 3552180143a86432bfec3e71ba2fdd7aaebb0549

Tree: 1bec759d22529875d4518fb8991e6972b4ad1ffe

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
optimize `@memset` with `undefined`

When using `@memset` to set bytes to `undefined`, Zig notices this
case and does a single Valgrind client request rather than N.

Speeds up all allocators in safe modes.

Closes #2388

```

## Parents

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

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