Skip to content

Commit 0b85833

Browse files
committed
add comment on the motivation as suggested by aviatesk
1 parent 0f8266b commit 0b85833

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/julia/kinds.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ function _register_kinds!(kind_modules, int_to_kindstr, kind_str_to_int, mod, mo
105105
_register_kinds_names!(int_to_kindstr, kind_str_to_int, module_id, names)
106106
end
107107

108+
# This function is separated from `_register_kinds!` to prevent sharing of the variable `i`
109+
# here and in the closure in `_register_kinds!`, which causes boxing and bad inference.
108110
function _register_kinds_names!(int_to_kindstr, kind_str_to_int, module_id, names)
109111
# Process names to conflate category BEGIN/END markers with the first/last
110112
# in the category.

0 commit comments

Comments
 (0)