Skip to content
class

OwnedMetalBuffer

OwnedMetalBuffer

RAII-owned variant of MetalBuffer.

Bundles a freshly allocated MetalBuffer with a std::shared_ptr whose custom deleter calls deallocate_shared when the last reference drops. Used by SharedStorage to express ref-counted shared GPU/CPU memory.

See Also

make_metal_shared — the factory that produces these.

Attributes

The underlying descriptor (still queryable for cpu_ptr / mtl_handle / nbytes).
ownerstd::shared_ptr<void>
Ref-counted owner that releases buf on last drop. Type- erased to void because the deleter, not the type, carries the cleanup logic.