Closed carstenbauer closed 8 months ago
The stack trace gives us a useful hint here.
AllocCheck.jl is highlighting a rare but valid allocation that might happen when broadcasting aliased arrays:
julia> A = rand(3,3);
julia> B = unsafe_wrap(Matrix{Float64}, pointer(A), size(A));
# A and B are aliased
julia> @allocated mycopy!(A, B) # triggers a defensive unaliascopy()
128
Since check_allocs
looks for allocations that might happen in any execution given the input types, the check is behaving correctly here.
Makes perfect sense, thanks. Although that means that all broadcasting expressions will show allocation errors which isn't great I guess. But fair enough for now.
Note that
@allocated
gives 0 whereascheck_allocs
highlights an allocation.