diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-10-25 21:16:51 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-10-25 21:16:51 +0200 |
| commit | c0710b0c42716bb7173b9fcc2785f9bf5175ae0f (patch) | |
| tree | 33144c17bd3606709342edde8db3b2549e1bccf8 /src/link.zig | |
| parent | 3d1d19f3877190db42544acf9e0ed26784ba82ba (diff) | |
| download | zig-c0710b0c42716bb7173b9fcc2785f9bf5175ae0f.tar.gz zig-c0710b0c42716bb7173b9fcc2785f9bf5175ae0f.zip | |
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.
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/link.zig b/src/link.zig index 9d4ac0d55b..39f51e90ec 100644 --- a/src/link.zig +++ b/src/link.zig @@ -696,6 +696,7 @@ pub const File = struct { GlobalTypeMismatch, InvalidCharacter, InvalidEntryKind, + InvalidFeatureSet, InvalidFormat, InvalidIndex, InvalidMagicByte, |
