| ... | ... | @@ -135,10 +135,9 @@ var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{ |
| 135 | 135 | pub fn main() anyerror!void { |
| 136 | 136 | crash_report.initialize(); |
| 137 | 137 | |
| 138 | | var gpa_need_deinit = false; |
| 138 | const use_gpa = build_options.force_gpa or !builtin.link_libc; |
| 139 | 139 | const gpa = gpa: { |
| 140 | | if (build_options.force_gpa or !builtin.link_libc) { |
| 141 | | gpa_need_deinit = true; |
| 140 | if (use_gpa) { |
| 142 | 141 | break :gpa general_purpose_allocator.allocator(); |
| 143 | 142 | } |
| 144 | 143 | // We would prefer to use raw libc allocator here, but cannot |
| ... | ... | @@ -148,7 +147,7 @@ pub fn main() anyerror!void { |
| 148 | 147 | } |
| 149 | 148 | break :gpa std.heap.raw_c_allocator; |
| 150 | 149 | }; |
| 151 | | defer if (gpa_need_deinit) { |
| 150 | defer if (use_gpa) { |
| 152 | 151 | _ = general_purpose_allocator.deinit(); |
| 153 | 152 | }; |
| 154 | 153 | var arena_instance = std.heap.ArenaAllocator.init(gpa); |