Skip to content

Conversation

@nsajko
Copy link
Member

@nsajko nsajko commented Aug 25, 2025

The variable i was unintentionally shared between the generator closure in _register_kinds! and another part of the body of _register_kinds!. Thus i was boxed, causing trouble for inference.

Fix this by moving the part of _register_kinds! with i to a new function.

Fixing this should make the sysimage more resistant to invalidation, once the change propagates to Julia itself.

The variable `i` was unintentionally shared between the generator
closure in `_register_kinds!` and another part of the body of
`_register_kinds!`. Thus `i` was boxed, causing trouble for inference.

Fix this by moving the part of `_register_kinds!` with `i` to a new
function.

Fixing this should make the sysimage more resistant to invalidation,
once the change propagates to Julia itself.
@nsajko
Copy link
Member Author

nsajko commented Aug 26, 2025

See the PR that backports this PR to JuliaSyntax v1 for info on the Julia sysimage invalidations that are fixed.

@aviatesk aviatesk merged commit 00bd17e into JuliaLang:main Aug 26, 2025
35 checks passed
@nsajko nsajko deleted the prevent_closure_capture-_register_kinds! branch August 26, 2025 07:19
nsajko added a commit to nsajko/JuliaSyntax.jl that referenced this pull request Aug 26, 2025
…liaLang#586)

The variable `i` was unintentionally shared between the generator
closure in `_register_kinds!` and another part of the body of
`_register_kinds!`. Thus `i` was boxed, causing trouble for inference.

Fix this by moving the part of `_register_kinds!` with `i` to a new
function.

Fixing this should make the sysimage more resistant to invalidation,
once the change propagates to Julia itself.

(cherry picked from commit 00bd17e)
aviatesk pushed a commit that referenced this pull request Aug 27, 2025
The variable `i` was unintentionally shared between the generator
closure in `_register_kinds!` and another part of the body of
`_register_kinds!`. Thus `i` was boxed, causing trouble for inference.

Fix this by moving the part of `_register_kinds!` with `i` to a new
function.

Fixing this should make the sysimage more resistant to invalidation,
once the change propagates to Julia itself.
aviatesk pushed a commit that referenced this pull request Sep 5, 2025
…) (#589)

The variable `i` was unintentionally shared between the generator
closure in `_register_kinds!` and another part of the body of
`_register_kinds!`. Thus `i` was boxed, causing trouble for inference.

Fix this by moving the part of `_register_kinds!` with `i` to a new
function.

Fixing this should make the sysimage more resistant to invalidation,
once the change propagates to Julia itself.

(cherry picked from commit 00bd17e)
c42f pushed a commit to JuliaLang/julia that referenced this pull request Oct 17, 2025
…liaLang/JuliaSyntax.jl#586)

The variable `i` was unintentionally shared between the generator
closure in `_register_kinds!` and another part of the body of
`_register_kinds!`. Thus `i` was boxed, causing trouble for inference.

Fix this by moving the part of `_register_kinds!` with `i` to a new
function.

Fixing this should make the sysimage more resistant to invalidation,
once the change propagates to Julia itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants