It looks like objc_retainAutoreleasedReturnValue might be exactly what I'm looking for, even if it isn't 100% guaranteed; if I'm understanding, it would be safe, and wouldn't actually leak as long as you had an autorelease pool somewhere in the chain. However, I'm not seeing a binding to it in the objc crate[3]. Sounds like maybe I should file an issue?
Also, given that such a method seems obviously useful, I wonder why it's not being called from these C++ bindings?
[1]: https://developer.apple.com/documentation/metal/mtlcommandbu...
[2]: https://github.com/gfx-rs/metal-rs/blob/master/src/commandbu...