diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-30 23:54:15 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-01 01:13:21 -0500 |
| commit | 4b6740e19d57454f3c4eac0c2e9a92ce08e7ec04 (patch) | |
| tree | f41867e2e9fcae52ab38590a3067b0396d23aff6 /src/list.hpp | |
| parent | 5026b1aad550bd85d12480e0a356302e858f8eef (diff) | |
| download | zig-4b6740e19d57454f3c4eac0c2e9a92ce08e7ec04.tar.gz zig-4b6740e19d57454f3c4eac0c2e9a92ce08e7ec04.zip | |
sometimes free stuff from Zig IR pass 1
Total bytes used in stage1 std lib tests:
3.418 -> 3.198 GiB (saving 225 MiB)
There's still this from pass 1 not getting freed:
Const: 6909049 items, 72 bytes each, total 474.407 MiB
This is due to 2 things hanging on to references to IrAnalyze pointers:
* ZigVar->owner_exec->analysis
* LazyValue->ira
The LazyValue one could be solved by memoizing the results after the
lazy value is resolved, and then it could unref the IrAnalyze.
ZigVars that are determined to be comptime const, could have their
const_value set to that value, instead of using the mem_slot_index
mechanism. This would prevent an IrAnalyze ref in some cases.
Diffstat (limited to 'src/list.hpp')
| -rw-r--r-- | src/list.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/list.hpp b/src/list.hpp index 59782b46a8..4b2833843b 100644 --- a/src/list.hpp +++ b/src/list.hpp @@ -13,7 +13,7 @@ template<typename T> struct ZigList { void deinit() { - free(items); + deallocate(items, capacity); } void append(const T& item) { ensure_capacity(length + 1); |
