What's the aliasing story in Julia

Lilith
Mon, 07 Aug 2023 13:43:33 +0000
General Usage

So let’s say I’m looking at a function that takes multiple mutable arguments, say, any! or extrema! or sortperm!, or sum!, or copyto!, or mul!. Who is responsible for handling aliasing? Am I ever allowed to pass in two objects that share memory and what can I expect if I do?

(c.f. aliasing in Julia · Issue #8087 · JuliaLang/julia · GitHub, sum!, prod!, any!, and all! may silently return incorrect results · Issue #39385 · JuliaLang/julia · GitHub, mitigate in-place reducedim alias bug by Moelf · Pull Request #45821 · JuliaLang/julia · GitHub)

37 posts - 18 participants