# link.File.Wasm: remove the "files" abstraction · gitcafe/zig

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

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

Visibility: public

Requested revision: ba2d006634925850fab9d0a0e01d87bdaa368108

Requested commit: ba2d006634925850fab9d0a0e01d87bdaa368108

Commit: ba2d006634925850fab9d0a0e01d87bdaa368108

Tree: a0bba99d508fe111cf967cbe5d27b55cf30cc972

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
link.File.Wasm: remove the "files" abstraction

Removes the `files` field from the Wasm linker, storing the ZigObject
as its own field instead using a tagged union.

This removes a layer of indirection when accessing the ZigObject, and
untangles logic so that we can introduce a "pre-link" phase that
prepares the linker state to handle only incremental updates to the
ZigObject and then minimize logic inside flush().

Furthermore, don't make array elements store their own indexes, that's
always a waste.

Flattens some of the file system hierarchy and unifies variable names
for easier refactoring.

Introduces type safety for optional object indexes.

```

## Parents

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

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