Julia–C mutable struct ownership across @cfunction boundary
Goal Define a clear ownership protocol for a mutable Julia struct that is allocated in Julia, passed to a C routine via @cfunction , mutated there, and then used again in Julia. Constraints Julia's garbage collector does not track memory allocated by C. The struct layout must match the C definition exactly, requiring @cstruct or manual marshaling. Performanc