# Zcu: extract permanent state from File · gitcafe/zig

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

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

Visibility: public

Requested revision: 30ec43a6c78d9c8803becbea5a02edb8fae08af6

Requested commit: 30ec43a6c78d9c8803becbea5a02edb8fae08af6

Commit: 30ec43a6c78d9c8803becbea5a02edb8fae08af6

Tree: fd827ce826b593a18c128d019eb9adffb3c2ca26

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Zcu: extract permanent state from File

Primarily, this commit removes 2 fields from File, relying on the data
being stored in the `files` field, with the key as the path digest, and
the value as the struct decl corresponding to the File. This table is
serialized into the compiler state that survives between incremental
updates.

Meanwhile, the File struct remains ephemeral data that can be
reconstructed the first time it is needed by the compiler process, as
well as operated on by independent worker threads.

A key outcome of this commit is that there is now a stable index that
can be used to refer to a File. This will be needed when serializing
error messages to survive incremental compilation updates.

```

## Parents

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

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