# wasm: ensure unique function indexes · gitcafe/zig

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

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

Visibility: public

Requested revision: c153f94c892fc3b718d29ba4ae3234e99d4baba4

Requested commit: c153f94c892fc3b718d29ba4ae3234e99d4baba4

Commit: c153f94c892fc3b718d29ba4ae3234e99d4baba4

Tree: 436ba6d7aaa2daa8860dc9b4096b23f336d46f3c

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: ensure unique function indexes

We cannot keep function indexes as maxInt(u32) due to functions being
dedupliated when they point to the same function. For this reason we now
use a regular arraylist which will have new functions appended to, and
when deleted, its index is appended to the free list, allowing us to
re-use slots in the function list.

```

## Parents

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

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