# wasm-linker: implement \_\_wasm_init_memory & flag · gitcafe/zig

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

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

Visibility: public

Requested revision: 4e0d7154b1a701b906f3d9c5401dc0109253971f

Requested commit: 4e0d7154b1a701b906f3d9c5401dc0109253971f

Commit: 4e0d7154b1a701b906f3d9c5401dc0109253971f

Tree: 36a7c5fa940450ad36698121a8723f7733cc59ea

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: implement __wasm_init_memory & flag

Implements the __wasm_init_memory and __wasm_init_memory_flag synthetic
function and symbol.

The former will initialize all passive segments during runtime. For the
bss section we will fill it with zeroes, whereas the other segments
will simply be initialized only.

The latter stores the offset into the linear data section, after all
heap memory that is part of the Wasm module. Any memory initialized
at runtime starts from this offset.

```

## Parents

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

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