Skip to content

Conversation

zerbina
Copy link
Collaborator

@zerbina zerbina commented Oct 12, 2025

Summary

Instead of all closures, only register those that contain potentially
cycle-introducing indirections as potential cycle roots, reducing
pressure on the cycle collector.

Details

While they don't need to be, the generated closure environment object
types were all marked as inheritable. Since the "potential cycle root"
detection treats non-final object types and object types containing
refs to non-final objects as potential cycle roots, this led to all
non-cyclic closure environments being candidates for being scanned by
the cycle collector.

Closure environment object types are now marked as final.

@zerbina zerbina added enhancement New feature or request compiler/sem Related to semantic-analysis system of the compiler labels Oct 12, 2025
@zerbina
Copy link
Collaborator Author

zerbina commented Oct 12, 2025

/merge

Copy link

Merge requested by: @zerbina

Contents after the first section break of the PR description has been removed and preserved below:


Notes for Reviewers

@chore-runner chore-runner bot added this pull request to the merge queue Oct 12, 2025
Merged via the queue into nim-works:devel with commit d47d73d Oct 12, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/sem Related to semantic-analysis system of the compiler enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants