diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-16 15:49:08 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-01 17:51:20 -0700 |
| commit | 9b98d33d0b76a8c8b23958c89ab7e952893697be (patch) | |
| tree | 7d9f8349366d92025c71cf7e328fe25cd25fa719 /src/Compilation.zig | |
| parent | f2564318385ea90b08af044ae32ddef26e6346bd (diff) | |
| download | zig-9b98d33d0b76a8c8b23958c89ab7e952893697be.tar.gz zig-9b98d33d0b76a8c8b23958c89ab7e952893697be.zip | |
Compilation: don't store arena until it's done being used
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 7314da3960..d8d8bbc39d 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1443,7 +1443,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { comp.* = .{ .gpa = gpa, - .arena = arena_allocator, + .arena = undefined, // populated after we are finished with `arena` .module = opt_zcu, .cache_use = undefined, // populated below .bin_file = null, // populated below @@ -1667,6 +1667,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { }, } + comp.arena = arena_allocator; break :comp comp; }; errdefer comp.destroy(); |
