Skip to content

Commit 48a8c34

Browse files
authored
Merge pull request #49 from JuliaLang/ct/add-warning
Add warning to `check_allocs(...)`
2 parents 03c3a48 + 875e3ba commit 48a8c34

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/AllocCheck.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,18 @@ end
170170
check_allocs(func, types; ignore_throw=true)
171171
172172
Compiles the given function and types to LLVM IR and checks for allocations.
173-
Returns a vector of `AllocationSite` structs, each containing a `CallInst` and a backtrace.
173+
174+
Returns a vector of `AllocationSite`, `DynamicDispatch`, and `AllocatingRuntimeCall`
175+
176+
!!! warning
177+
The Julia language/compiler does not guarantee that this result is stable across
178+
Julia invocations.
179+
180+
If you rely on allocation-free code for safety/correctness, it is not sufficient
181+
to verify `check_allocs` in test code and expect that the corresponding call in
182+
production will not allocate at runtime.
183+
184+
For this case, you must use `@check_allocs` instead.
174185
175186
# Example
176187
```jldoctest

0 commit comments

Comments
 (0)