# wasm: Improve memset implementation · gitcafe/zig

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

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

Visibility: public

Requested revision: 215a22541c2a5b9886173dca86e2990ae5c649d1

Requested commit: 215a22541c2a5b9886173dca86e2990ae5c649d1

Commit: 215a22541c2a5b9886173dca86e2990ae5c649d1

Tree: 491fce66ba10538c36b3030351f686ca1cb98bb4

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: Improve memset implementation

When the length is comptime-known, we perform an inline loop instead of emitting
a runtime loop into the binary.

This also allows us to easily write 'undefined' to aggregate types.
We now do this when we set the error tag of an error union where the payload will be set to undefined.

```

## Parents

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

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