Module Backend_impl.Make_slab

Backs the device-level slab interface with a backend's raw byte-buffer primitives and a private (device_id, pool_id) -> 'base table. Replaces the old Alloc_buffer_ignore_stream.

Parameters

Signature

type device = Device_types.device
include Backend_intf.Slab_alloc with type device := device
val alloc_pool : ?mode:Tnode.memory_mode -> device -> pool_id:Base.int -> size_in_bytes:Base.int -> alignment:Base.int -> Base.unit

Allocates the slab for pool_id on device. The optional ?mode carries the tnode's memory mode so backends can pick a storage mode (Metal private vs. shared); backends that do not care ignore it.

val free_pool : (device -> pool_id:Base.int -> Base.unit) Base.option

Frees the slab for pool_id and drops its table entry. None for backends that rely on GC.

val memset_zero : device -> pool_id:Base.int -> offset:Base.int -> size_in_bytes:Base.int -> Base.unit

Zero-initializes size_in_bytes at base_of pool_id + offset.

type buffer_ptr = Raw.buffer_ptr
val resolve_pool : device -> Backend_intf.buffer_loc -> buffer_ptr