Expand description
Host-only region placement over an integer byte range.
No Vulkan memory, buffers, mapping, synchronization or implicit retirement is provided. Consumers own the validity/completion of any resource using these offsets. Tokens are explicit: dropping one does not release its region.
use vk::memory::{PlacementStrategy, VirtualBlock};
let mut block = VirtualBlock::new(4096)?;
let mut region = block.allocate(64, 16, PlacementStrategy::Default)?;
assert_eq!(block.allocation_info(®ion)?.offset, 0);
block.free(&mut region)?;Structs§
- Virtual
Allocation - Generation-checked identity in exactly one virtual block; no implicit free.
- Virtual
Allocation Info - Placement snapshot; valid only while the matching allocation remains live.
- Virtual
Block - Virtual TLSF allocator; owns host metadata and no native objects.
- Virtual
Block Stats - Host metadata statistics. Alignment holes remain free, not reserved to a token.
Enums§
- Placement
Strategy - VMA virtual-TLSF search order; these policies are not latency guarantees.
Functions§
- allocate
- Allocate a nonzero region with a nonzero power-of-two alignment.
- allocation_
info - Reject foreign, freed or stale tokens before reading placement metadata.
- clear
- Clear all regions, invalidating every prior generation; never submits or waits.
- free
- Free a checked live region and invalidate its token; no native effects.
- statistics
- Calculate allocation bytes, free bytes, free-region count and largest span.