OwnedMetalBuffer make_metal_shared(int nbytes)Allocate a shared Metal buffer wrapped in an RAII owner.
Combines allocate_shared with a shared_ptr whose
destructor releases the allocation. Preferred entry point for
Storage construction code paths that need automatic cleanup.
See Also
allocate_shared — non-owning variant.
Parameters
nbytesstd::size_tAllocation size in bytes.
Returns
OwnedMetalBufferBundle whose owner keeps buf alive for as long as any copy of the shared_ptr survives.
Examples
Construct a 1 KiB shared buffer:: auto owned = lucid::gpu::make_metal_shared(1024);
// owned.buf.cpu_ptr ↔ owned.buf.mtl_handle alias same pages.