Commit 61a9ebf
committed
ast_types: fix possible memory leak with
Summary
=======
Fix a compiler memory leak involving diagnostics. Only long running
processes, such as `nimsuggest`, were affected to a significant degree.
Details
=======
While diagnostics mustn't hold a tree directly holding a reference to
the diagnostic itself (which is the assumption the decision to use
`TAstDiag` as `.acyclic` was based on), it's possible (and valid) for a
diagnostic to contain a tree that holds a reference to a symbol, which
in turn holds a reference to the tree containing the diagnostic
(a reference cycle).
Due to the `.acyclic` marker on `TAstDiag`, all reference cycles in
which a `TAstDiag` is a contributor were never freed. The `.acyclic`
marker is removed, fixing the problem.TAstDiag
1 parent efa5d09 commit 61a9ebf
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
| 1281 | + | |
1284 | 1282 | | |
1285 | 1283 | | |
1286 | 1284 | | |
| |||
0 commit comments