AllocCheck.@check_allocs
— Macro@check_allocs ignore_throw=true (function def)
Wraps the provided function definition so that all calls to it will be automatically checked for allocations.
If the check fails, an AllocCheckFailure
exception is thrown containing the detailed failures, including the backtrace for each defect.
Note: All calls to the wrapped function are effectively a dynamic dispatch, which means they are type-unstable and may allocate memory at function entry. @check_allocs
only guarantees the absence of allocations after the function has started running.
Example
julia> @check_allocs multiply(x,y) = x*y
+AllocCheck.AllocationSite[]