aboutsummaryrefslogtreecommitdiff
path: root/lib/std/std.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-19 21:51:08 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-04-20 17:37:35 -0700
commitf7596ae9423e9de8276629803147e1a243f2177b (patch)
treeb97f2a8e8fdb84a118f587bcbfd76918710587dd /lib/std/std.zig
parent4f527e5d36f66a83ff6a263a03f16e2c4d049f1e (diff)
downloadzig-f7596ae9423e9de8276629803147e1a243f2177b.tar.gz
zig-f7596ae9423e9de8276629803147e1a243f2177b.zip
stage2: use indexes for Decl objects
Rather than allocating Decl objects with an Allocator, we instead allocate them with a SegmentedList. This provides four advantages: * Stable memory so that one thread can access a Decl object while another thread allocates additional Decl objects from this list. * It allows us to use u32 indexes to reference Decl objects rather than pointers, saving memory in Type, Value, and dependency sets. * Using integers to reference Decl objects rather than pointers makes serialization trivial. * It provides a unique integer to be used for anonymous symbol names, avoiding multi-threaded contention on an atomic counter.
Diffstat (limited to 'lib/std/std.zig')
0 files changed, 0 insertions, 0 deletions