aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-10-25 21:16:51 +0200
committerLuuk de Gram <luuk@degram.dev>2022-10-25 21:16:51 +0200
commitc0710b0c42716bb7173b9fcc2785f9bf5175ae0f (patch)
tree33144c17bd3606709342edde8db3b2549e1bccf8 /src/link.zig
parent3d1d19f3877190db42544acf9e0ed26784ba82ba (diff)
downloadzig-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.zig1
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,