Realm

vk::mem · Functions · S1

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

FnRustExperimental

Fnvk::mem::set_allocation_name

pub fn set_allocation_name( allocator: &mut Allocator<'_>, allocation: &Allocation, name: Option<&str>, ) -> Result<(), AllocError>
Replace a copied UTF-8 diagnostic name transactionally; None clears it.

Contract

Replace a copied UTF-8 diagnostic name transactionally; None clears it.

Errors

Identity/state or host reservation failure leaves the previous name intact.

Fnvk::mem::set_allocation_pinned

pub fn set_allocation_pinned( allocator: &mut Allocator<'_>, allocation: &Allocation, pinned: bool, ) -> Result<(), AllocError>
Explicitly pin/unpin a region against future allocator relocation planning.

Contract

Explicitly pin/unpin a region against future allocator relocation planning.

Fnvk::mem::set_allocation_user_data

pub fn set_allocation_user_data( allocator: &mut Allocator<'_>, allocation: &Allocation, data: usize, ) -> Result<(), AllocError>
Set uninterpreted consumer metadata. It is never dereferenced, freed or owned.

Contract

Set uninterpreted consumer metadata. It is never dereferenced, freed or owned.

Fnvk::mem::set_current_frame_index

Contract

Mark a frame boundary for budget refresh; this never retires resources or waits.

Fnvk::mem::set_debug_memory_settings

pub fn set_debug_memory_settings( allocator: &mut Allocator<'_>, settings: DebugMemorySettings, ) -> Result<(), AllocError>
Configure debug instrumentation before native allocations or pools exist.

Contract

Configure debug instrumentation before native allocations or pools exist.

Errors

Rejects live domains, non-four-byte guard margins or missing required map PFNs.

Fnvk::mem::set_external_memory_types

pub unsafe fn set_external_memory_types( allocator: &mut Allocator<'_>, types: &[ExternalMemoryHandleTypeFlags], ) -> Result<(), AllocError>
Configure copied per-memory-type external export flags before creating pools/storage. Zero flags leave that type ordinary. Every native allocation of a configured type receives VkExportMemoryAllocateInfo, including separate allocations.

Contract

Configure copied per-memory-type external export flags before creating pools/storage. Zero flags leave that type ordinary. Every native allocation of a configured type receives VkExportMemoryAllocateInfo, including separate allocations.

Errors

Rejects live domains, incorrect array length and unavailable handle extensions.

Safety

Flags must be supported and mutually compatible for every resource subsequently allocated on each type, including external dedication requirements. No support query is implied. Matching external resource create chains remain required.

Fnvk::mem::set_heap_limit

Contract

Change a local policy ceiling; this never reserves native heap capacity.

Fnvk::mem::set_mapping_hysteresis

pub fn set_mapping_hysteresis( allocator: &mut Allocator<'_>, enabled: bool, ) -> Result<(), AllocError>
Configure native pooled mapping retention before creating storage or pools. Enabled by default. Separate allocations never cache mappings. This affects native map/unmap call counts, never allocation-level pointer access rights.

Contract

Configure native pooled mapping retention before creating storage or pools. Enabled by default. Separate allocations never cache mappings. This affects native map/unmap call counts, never allocation-level pointer access rights.

Errors

Rejects a closed allocator or any existing native/pool domain.

Fnvk::mem::set_pool_name

pub fn set_pool_name( allocator: &mut Allocator<'_>, pool: &Pool, name: Option<&str>, ) -> Result<(), AllocError>
Replace a pool diagnostic name; metadata allocation failure preserves its old name.

Contract

Replace a pool diagnostic name; metadata allocation failure preserves its old name.

Fnvk::mem::set_preferred_block_size

pub fn set_preferred_block_size( allocator: &mut Allocator<'_>, size: u64, ) -> Result<(), AllocError>
Set preferred block bytes for heaps larger than 1 GiB before pool/storage creation. Small heaps use one eighth of their heap size; both paths round up to 32 bytes. Does not alter explicit Pooled/Adaptive policies or query/reserve a budget.

Contract

Set preferred block bytes for heaps larger than 1 GiB before pool/storage creation. Small heaps use one eighth of their heap size; both paths round up to 32 bytes. Does not alter explicit Pooled/Adaptive policies or query/reserve a budget.

Errors

Rejects zero/overflowing sizes, closed state and existing native/pool domains.

Fnvk::mem::statistics

Contract

Calculate local live-region/native-block accounting without querying the driver.