Realm

vk::mem::virtual_block · Functions · A1

3 public declarations with native signatures and source-owned contracts.

FnRustExperimental

Fnvk::mem::virtual_block::allocate

pub fn allocate( block: &mut VirtualBlock<'_>, size: u64, alignment: u64, strategy: PlacementStrategy, ) -> Result<VirtualAllocation, AllocError>
Allocate a nonzero region with a nonzero power-of-two alignment.

Contract

Allocate a nonzero region with a nonzero power-of-two alignment.

Failure leaves placements and donor free-list ordering unchanged. Only host metadata is allocated; no Vulkan calls or memory mapping occur.

Fnvk::mem::virtual_block::allocate_upper

Contract

Allocate downward from the upper end of a linear block.

Errors

Rejects TLSF, active ring mode, invalid extents/alignment and exhausted space/metadata.

Fnvk::mem::virtual_block::allocation_info

pub fn allocation_info( block: &VirtualBlock<'_>, allocation: &VirtualAllocation, ) -> Result<VirtualAllocationInfo, AllocError>
Reject foreign, freed or stale tokens before reading placement metadata.

Contract

Reject foreign, freed or stale tokens before reading placement metadata.