Why is this code allocating?

OK, found the answer: I need to put my code into a function to measure allocations:

function test(body_aero)
    for panel in body_aero.panels end
end

test(body_aero)
@allocated test(body_aero)

This doesn’t allocate.

2 Likes