# wasm: Implement memset, and sret arguments\. · gitcafe/zig

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

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

Visibility: public

Requested revision: 89b1fdc4437531776b46ed7133c44b7250c122f8

Requested commit: 89b1fdc4437531776b46ed7133c44b7250c122f8

Commit: 89b1fdc4437531776b46ed7133c44b7250c122f8

Tree: 95d629f527158751b0828b274f96b5e32c924d12

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: Implement memset, and sret arguments.

We now detect if the return type will be set by passing the first argument
as a pointer to stack memory from the callee's frame. This way, we do not have to
worry about stack memory being overwritten.

Besides this, we implement memset by either using wasm's memory.fill instruction when available,
or lower it manually. In the future we can lower this to a compiler_rt call.

```

## Parents

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

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