diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-11-12 15:45:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-11-12 23:21:21 -0500 |
| commit | 91b897ef581aec65dd7a080754ab09d2e176ed8f (patch) | |
| tree | 6c6a7a2a3776d579619c6ed1cda49f5392f63640 /lib/std/Build/Step/Compile.zig | |
| parent | 53500a57684665e08a2e18e7a736aacfa6548062 (diff) | |
| download | zig-91b897ef581aec65dd7a080754ab09d2e176ed8f.tar.gz zig-91b897ef581aec65dd7a080754ab09d2e176ed8f.zip | |
rework memory management of Module.Namespace hash maps
The motivating problem here was a memory leak in the hash maps of
Module.Namespace.
The commit deletes more of the legacy incremental compilation
implementation. It had things like use of orderedRemove and trying to do
too much OOP-style creation and deletion of objects.
Instead, this commit iterates over all the namespaces on Module deinit
and calls deinit on the hash map fields. This logic is much simpler to
reason about.
Similarly, change global inline assembly to an array hash map since
iterating over the values is a primary use of it, and clean up the
remaining values on Module deinit, solving another memory leak.
After this there are no more memory leaks remaining when using the
x86 backend in a libc-less compiler.
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
0 files changed, 0 insertions, 0 deletions
