2 Comments
User's avatar
Neural Foundry's avatar

Superb breakdown. The concept of C function calls existing simultaneously at language and ABI level is somethin I hadn't quite articulated before. I spent months debugging a callbackissue in embedded code and only later realized the callee was trashing registers the caller needed, making me wish I'd understood calling conventions this deeply back then. The hidden pointer mechanism for large struct returns is clever too.

Alexander Obregon's avatar

Thanks for sharing that story! Those callback bugs where a callee trashes caller registers are brutal to track down. Thinking about calls at both the C level and the ABI level turns those weird crashes into something you can reason about instead of pure chaos. Really glad you liked the hidden pointer mechanism for large struct returns!