Stream: helpdesk (published)

Topic: ScopedValues are allocating in specific contexts


view this post on Zulip Júlio Hoffimann (Apr 14 2026 at 00:12):

We use ScopedValues.jl to customize tolerances in our codebase as you can see here:

https://github.com/JuliaGeometry/Meshes.jl/blob/e9207dfcf0b1edc7f18e0ab955409cc8802f15dc/src/tolerances.jl#L5-L25

but for some reason calling Meshes.atol(Float64) allocates.

view this post on Zulip Júlio Hoffimann (Apr 14 2026 at 00:12):

The same code doesn't allocate when copied/pasted in the REPL.

view this post on Zulip Júlio Hoffimann (Apr 14 2026 at 00:13):

@Jeffrey Chandler has tried Cthulhu.jl as you can see here: #meshes.jl > general chat @ 💬

view this post on Zulip Júlio Hoffimann (Apr 14 2026 at 00:15):

Appreciate it if someone with experience in ScopedValues.jl could share what might be happening.

view this post on Zulip Júlio Hoffimann (Apr 14 2026 at 00:15):

We also tried with the ScopedValues stdlib, and there is no difference in behavior.


Last updated: Apr 21 2026 at 06:18 UTC