xalloc
Dynamic suballocators for external memory (e.g., Vulkan device memory).
Provided Algorithms
Name | Time Complexity | Space Complexity |
---|---|---|
TLSF (Two-Level Segregated Fit) | O(1) |
O(N) |
Free space bitmap | O(size) |
O(size) |
(size
: heap size measured by the number of allocation units, N
: number of allocations)
Examples
let mut tlsf = new;
// Allocate regions
let = tlsf.alloc.unwrap;
let = tlsf.alloc.unwrap;
println!;
println!;
// Deallocate a region
tlsf.dealloc.unwrap;
// Now we can allocate again
tlsf.alloc.unwrap;
tlsf.alloc.unwrap;
Feature Flags
nightly
— Enables optimizations which currently require a Nightly Rust compiler.
License: MIT