You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/src/manual/functions.md
+3
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,9 @@ As a common convention in Julia (not a syntactic requirement), such a function w
102
102
[typically be named `f!(x, y)`](@ref man-punctuation) rather than `f(x, y)`, as a visual reminder at
103
103
the call site that at least one of the arguments (often the first one) is being mutated.
104
104
105
+
!!! warning "Shared memory between arguments"
106
+
The behavior of a mutating function can be unexpected when a mutated argument shares memory with another argument, a situation known as aliasing (e.g. when one is a view of the other).
107
+
Unless the function docstring explicitly indicates that aliasing produces the expected result, it is the responsibility of the caller to ensure proper behavior on such inputs.
0 commit comments