Skip to content

Commit 5741911

Browse files
authored
Add the fact that functions ending with ! may allocate to the FAQ (#58904)
I've run into this question several times, that might count as "frequently asked".
1 parent 6efd218 commit 5741911

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/src/manual/faq.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@ julia> twothreearr()
391391
3
392392
```
393393

394+
### Is a function that ends with `!` allowed to allocate?
395+
396+
Yes! A function name ending with `!` indicates that the function mutates at
397+
least one of its arguments (typically the first argument). However, it may
398+
still allocate a scratch space to expedite computation or produce that result.
399+
394400
## Types, type declarations, and constructors
395401

396402
### [What does "type-stable" mean?](@id man-type-stability)

0 commit comments

Comments
 (0)