aboutsummaryrefslogtreecommitdiff
path: root/src/link/Plan9.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-08-24 20:43:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-09-21 14:48:40 -0700
commitaccd5701c251c2741479fe08e56c8271c444f021 (patch)
tree78871f150609687a9210063e90f8f4eb53997c38 /src/link/Plan9.zig
parent0345d7866347c9066b0646f9e46be9a068dcfaa3 (diff)
downloadzig-accd5701c251c2741479fe08e56c8271c444f021.tar.gz
zig-accd5701c251c2741479fe08e56c8271c444f021.zip
compiler: move struct types into InternPool proper
Structs were previously using `SegmentedList` to be given indexes, but were not actually backed by the InternPool arrays. After this, the only remaining uses of `SegmentedList` in the compiler are `Module.Decl` and `Module.Namespace`. Once those last two are migrated to become backed by InternPool arrays as well, we can introduce state serialization via writing these arrays to disk all at once. Unfortunately there are a lot of source code locations that touch the struct type API, so this commit is still work-in-progress. Once I get it compiling and passing the test suite, I can provide some interesting data points such as how it affected the InternPool memory size and performance comparison against master branch. I also couldn't resist migrating over a bunch of alignment API over to use the log2 Alignment type rather than a mismash of u32 and u64 byte units with 0 meaning something implicitly different and special at every location. Turns out you can do all the math you need directly on the log2 representation of alignments.
Diffstat (limited to 'src/link/Plan9.zig')
-rw-r--r--src/link/Plan9.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/link/Plan9.zig b/src/link/Plan9.zig
index d88816f912..98f5b37a82 100644
--- a/src/link/Plan9.zig
+++ b/src/link/Plan9.zig
@@ -1106,7 +1106,7 @@ fn updateLazySymbolAtom(self: *Plan9, sym: File.LazySymbol, atom_index: Atom.Ind
const gpa = self.base.allocator;
const mod = self.base.options.module.?;
- var required_alignment: u32 = undefined;
+ var required_alignment: InternPool.Alignment = .none;
var code_buffer = std.ArrayList(u8).init(gpa);
defer code_buffer.deinit();