# use fixed-size arrays for feature lists · gitcafe/zig

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

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

Visibility: public

Requested revision: c0710b0c42716bb7173b9fcc2785f9bf5175ae0f

Requested commit: c0710b0c42716bb7173b9fcc2785f9bf5175ae0f

Commit: c0710b0c42716bb7173b9fcc2785f9bf5175ae0f

Tree: 33144c17bd3606709342edde8db3b2549e1bccf8

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
use fixed-size arrays for feature lists

Considering all possible features are known by the linker during
compile-time, we can create arrays on the stack instead of
dynamically allocating hash maps. We use a simple bitset to determine
whether a feature is enabled or not, and from which object file
it originates. This allows us to make feature validation slightly
faster and use less runtime memory.
In the future this could be enhanced further by having a single
array instead with a more sophisticated bitset.

```

## Parents

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

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