# sema: rework comptime mutation · gitcafe/zig

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

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

Visibility: public

Requested revision: f34deec4e23281ea51a27056ffba7955697e2141

Requested commit: f34deec4e23281ea51a27056ffba7955697e2141

Commit: f34deec4e23281ea51a27056ffba7955697e2141

Tree: 625630b3f9e0137e4ce8f99cc324438ab79411dc

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
sema: rework comptime mutation

Split Value into an immutable value that always has an InternPool.Index
representation, and a mutable value that is part of a new ComptimeMemory
abstraction.

Mainly, this deletes WipAnonDecl, deletes
InternPool.Key.Ptr.Addr.MutDecl, and then updates all comptime-mutable
allocations to happen via ComptimeMemory.

This makes no comptime mutable memory escape from the Sema instance in
which the comptime memory is allocated, reducing the amount of garbage
in the global InternPool, and forces comptime memory mutations to be
completely reworked in the compiler.

This has sweeping implications to the codebase, and will require quite a
few follow up changes to unbreak things

```

## Parents

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

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