@code_warntype but for allocations?

Is there a similar macro to @code_warntype for allocations? As in, given a function call (or function and tuple of input types), highlights any calls in the function that allocate, just as code_warntype highlights sub expressions that are type unstable.

@time and @btime are fantastic for determining whether code is allocating but not as good for hunting the source down.

If no such macro exists, would people find one useful?

2 Likes

https://docs.julialang.org/en/v1/manual/profile/#Memory-allocation-analysis-1