# compiler: packed structs cache bit offsets · gitcafe/zig

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

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

Visibility: public

Requested revision: a7088fd9a3edb037f0f51bb402a3c557334634f3

Requested commit: a7088fd9a3edb037f0f51bb402a3c557334634f3

Commit: a7088fd9a3edb037f0f51bb402a3c557334634f3

Tree: dba5fd9f32b341d1cb64b9813033e1558c1e8d2b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
compiler: packed structs cache bit offsets

Instead of linear search every time a packed struct field's bit or byte
offset is wanted, they are computed once during resolution of the packed
struct's backing int type, and stored in InternPool for O(1) lookup.

Closes #17178

```

## Parents

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

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