Skip to content
fn

deallocate_shared

void deallocate_shared(MetalBuffer & buf)

Release the Metal buffer held in buf and zero all fields.

Drops the CFRetain on buf.mtl_handle and clears the descriptor in place so callers cannot reuse the dangling pointer by accident. Calling this on a zero-initialised MetalBuffer is a no-op (safe).

Parameters

The descriptor to release. Mutated to the zero state.

Notes

Marked noexcept — failures from the underlying Obj-C release are silently swallowed because there is no recoverable action.