Clear out checker-level stacks on pop#62016
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that stack-based contextual types, inference contexts, and active mapper caches are explicitly cleared when popping to avoid holding onto stale references and potential memory leaks.
- Clear references in
popContextualTypeandpopInferenceContext - Adjust
pushActiveMapperto reuse existing cache maps with??= - Clear mapper entries and cache contents in
popActiveMapper
Comments suppressed due to low confidence (2)
|
@typescript-bot test it |
|
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
|
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
RyanCavanaugh
left a comment
There was a problem hiding this comment.
LGTM. I like to use undefined! in these situations but as any is just as good.
|
Oh, oops, that's the incantation I meant to use. |
|
Need a re-review now, sorry; I definitely meant |
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
These global-ish stacks left their references behind on pop. If the contents are ephemeral (sometimes happens with types, mappers), they'll be held indefinitely.
See also: