aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-11-12 15:45:10 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-11-12 23:21:21 -0500
commit91b897ef581aec65dd7a080754ab09d2e176ed8f (patch)
tree6c6a7a2a3776d579619c6ed1cda49f5392f63640 /lib/std
parent53500a57684665e08a2e18e7a736aacfa6548062 (diff)
downloadzig-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')
0 files changed, 0 insertions, 0 deletions