vk::mem · Structs · S1
2 public declarations with native signatures and source-owned contracts.
Stvk::mem::SynchronizedAllocator
Contract
One allocator with synchronized direct operations and concurrent pool scopes.
Placement uses one mutex per owner. Direct map/unmap/bind operations acquire a live allocation lease, then execute under that backing’s stable mutex without the placement mutex. Other backings can map/bind, allocate and free concurrently, including inside the same pool. Regions sharing one backing serialize native map/bind work and retain exact explicit/persistent counts. The first such operation fallibly reserves callback-owned backing metadata.
Borrowed results, relocation and global services use exclusive access and
wait for outstanding native leases. try_with_allocator reports busy during
those leases. Borrowed pool/type/block scopes add independent placement
owners for their documented domains. There is no process-global lock or
new Send/Sync assertion on ordinary Allocator. Performance is unmeasured.
Callbacks must never reenter this owner or create cross-owner lock cycles.
Vulkan completion and mapped-byte synchronization remain caller obligations.
Drop frees CPU metadata only; explicitly close native storage before Drop.
A scoped operation cannot return its allocator borrow:
let escaped = unsafe { shared.with_allocator(|allocator| allocator) };
An existing ordinary allocator’s device borrow may still be shortened:
fn shorten<'device: 'scope, 'scope>(owner: vk::Allocator<'device>) -> vk::Allocator<'scope> {
owner
}
The ordinary allocator remains non-Send:
ⓘfn require_send<T: Send>() {}
require_send::<vk::Allocator<'static>>();
// SAFETY: retained chains/callbacks and mapped storage satisfy new's
// any-thread contract through final host cleanup.
let shared = unsafe { vk::SynchronizedAllocator::new(allocator) };
std::thread::scope(|scope| {
scope.spawn(|| {
// SAFETY: no replacement/thread-affine state is installed; no
// native work is live and ordinary close preconditions hold.
unsafe { shared.with_allocator(|allocator| allocator.close()) }??;
Ok::<_, vk::AllocError>(())
}).join().unwrap()
})?;Methods and associated items
live_count
Number of live allocation registrations under this allocator’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
is_closed
Observe explicit close state under this allocator’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
max_allocation_size
Optional caller-configured size limit under this allocator’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
close
Close the allocator under its lock; later access reports Closed.
Concurrent operations complete or fail before this runs.
Errors
Same live-resource errors as Allocator::close, plus SynchronizationPoisoned.
allocator_info
Captured native identities under this allocator’s lock.
Errors
Same errors as Allocator::allocator_info, plus SynchronizationPoisoned.
memory_type_properties
Queried properties of one native memory type under this allocator’s lock.
Errors
Same errors as Allocator::memory_type_properties, plus SynchronizationPoisoned.
find_memory_type
Score memory types for one allocation request under this allocator’s lock.
Errors
Same errors as Allocator::find_memory_type, plus SynchronizationPoisoned.
find_memory_type_for_buffer_info
Score memory types for one buffer’s requirements under this allocator’s lock.
Errors
Same errors as Allocator::find_memory_type_for_buffer_info, plus SynchronizationPoisoned.
Safety
Same create-chain and requirement query contract as
Allocator::find_memory_type_for_buffer_info.
find_memory_type_for_image_info
Score memory types for one image’s requirements under this allocator’s lock.
Errors
Same errors as Allocator::find_memory_type_for_image_info, plus SynchronizationPoisoned.
Safety
Same create-chain and requirement query contract as
Allocator::find_memory_type_for_image_info.
allocate
Run Allocator::allocate under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate, plus SynchronizationPoisoned.
Safety
Same request/chain/import and completion contract as Allocator::allocate.
allocate_with_options
Run Allocator::allocate_with_options under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate_with_options, plus SynchronizationPoisoned.
Safety
Same requirements/options/chain contract as Allocator::allocate_with_options.
allocate_dedicated
Run Allocator::allocate_dedicated under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate_dedicated, plus SynchronizationPoisoned.
Safety
Same requirements/chain/import contract as Allocator::allocate_dedicated.
allocate_many
Run Allocator::allocate_many under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate_many, plus SynchronizationPoisoned.
Safety
Same requirements/options contract as Allocator::allocate_many.
free
Run Allocator::free under this allocator’s lock.
Errors
Same checked/native errors as Allocator::free, plus SynchronizationPoisoned.
Safety
Same live-token, mapped-byte and completion contract as Allocator::free.
free_many
Run Allocator::free_many under this allocator’s lock.
Errors
Same checked/native errors as Allocator::free_many, plus SynchronizationPoisoned.
Safety
Same live-token and completion contract as Allocator::free_many.
allocation_info
Checked allocation snapshot under this allocator’s lock.
Errors
Same errors as Allocator::allocation_info, plus SynchronizationPoisoned.
set_allocation_pinned
Run Allocator::set_allocation_pinned under this allocator’s lock.
Errors
Same errors as Allocator::set_allocation_pinned, plus SynchronizationPoisoned.
set_allocation_name
Run Allocator::set_allocation_name under this allocator’s lock.
Errors
Same errors as Allocator::set_allocation_name, plus SynchronizationPoisoned.
set_allocation_user_data
Run Allocator::set_allocation_user_data under this allocator’s lock.
Errors
Same errors as Allocator::set_allocation_user_data, plus SynchronizationPoisoned.
create_buffer
Run Allocator::create_buffer under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_buffer, plus SynchronizationPoisoned.
Safety
Same resource/allocation contract as Allocator::create_buffer.
create_buffer_with_options
Run Allocator::create_buffer_with_options under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_buffer_with_options, plus SynchronizationPoisoned.
Safety
Same resource/allocation contract as Allocator::create_buffer_with_options.
create_dedicated_buffer
Run Allocator::create_dedicated_buffer under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_dedicated_buffer, plus SynchronizationPoisoned.
Safety
Same resource/chain/import contract as Allocator::create_dedicated_buffer.
destroy_buffer
Run Allocator::destroy_buffer under this allocator’s lock.
Errors
Same checked errors as Allocator::destroy_buffer, plus SynchronizationPoisoned.
Safety
Same resource ownership and completion contract as Allocator::destroy_buffer.
create_image
Run Allocator::create_image under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_image, plus SynchronizationPoisoned.
Safety
Same resource/allocation contract as Allocator::create_image.
create_image_with_options
Run Allocator::create_image_with_options under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_image_with_options, plus SynchronizationPoisoned.
Safety
Same resource/allocation contract as Allocator::create_image_with_options.
create_dedicated_image
Run Allocator::create_dedicated_image under this allocator’s lock.
Errors
Same transaction errors as Allocator::create_dedicated_image, plus SynchronizationPoisoned.
Safety
Same resource/chain/import contract as Allocator::create_dedicated_image.
destroy_image
Run Allocator::destroy_image under this allocator’s lock.
Errors
Same checked errors as Allocator::destroy_image, plus SynchronizationPoisoned.
Safety
Same resource ownership and completion contract as Allocator::destroy_image.
allocate_for_buffer
Run Allocator::allocate_for_buffer under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate_for_buffer, plus SynchronizationPoisoned.
Safety
Same external-resource and allocation contract as Allocator::allocate_for_buffer.
allocate_for_image
Run Allocator::allocate_for_image under this allocator’s lock.
Errors
Same checked/native errors as Allocator::allocate_for_image, plus SynchronizationPoisoned.
Safety
Same external-resource and allocation contract as Allocator::allocate_for_image.
create_aliasing_buffer
Run Allocator::create_aliasing_buffer under this allocator’s lock.
Errors
Same checked errors as Allocator::create_aliasing_buffer, plus SynchronizationPoisoned.
Safety
Same alias/storage contract as Allocator::create_aliasing_buffer.
create_aliasing_image
Run Allocator::create_aliasing_image under this allocator’s lock.
Errors
Same checked errors as Allocator::create_aliasing_image, plus SynchronizationPoisoned.
Safety
Same alias/storage contract as Allocator::create_aliasing_image.
copy_to_allocation
Run Allocator::copy_to_allocation under this allocator’s lock.
Errors
Same checked errors as Allocator::copy_to_allocation, plus SynchronizationPoisoned.
Safety
Same mapped-range and byte-validity contract as Allocator::copy_to_allocation.
copy_from_allocation
Run Allocator::copy_from_allocation under this allocator’s lock.
Errors
Same checked errors as Allocator::copy_from_allocation, plus SynchronizationPoisoned.
Safety
Same mapped-range and byte-validity contract as Allocator::copy_from_allocation.
bind_buffer_memory
Run Allocator::bind_buffer_memory under a live lease and this backing’s mutex.
Errors
Same checked errors as Allocator::bind_buffer_memory, plus SynchronizationPoisoned.
Safety
Same native binding contract as Allocator::bind_buffer_memory.
bind_image_memory
Run Allocator::bind_image_memory under a live lease and this backing’s mutex.
Errors
Same checked errors as Allocator::bind_image_memory, plus SynchronizationPoisoned.
Safety
Same native binding contract as Allocator::bind_image_memory.
bind_buffer_memory2
Run Allocator::bind_buffer_memory2 under a live lease and this backing’s mutex.
Errors
Same checked errors as Allocator::bind_buffer_memory2, plus SynchronizationPoisoned.
Safety
Same native chain/binding contract as Allocator::bind_buffer_memory2.
bind_image_memory2
Run Allocator::bind_image_memory2 under a live lease and this backing’s mutex.
Errors
Same checked errors as Allocator::bind_image_memory2, plus SynchronizationPoisoned.
Safety
Same native chain/binding contract as Allocator::bind_image_memory2.
map
Run Allocator::map under a live lease and this backing’s mutex.
Errors
Same checked/native errors as Allocator::map, plus SynchronizationPoisoned.
Safety
May fail to reserve the stable backing metadata before native effects.
Same mapping, mapped-byte synchronization and completion contract as
Allocator::map; escaping pointers retain SynchronizedAllocator rules.
unmap
Run Allocator::unmap under a live lease and this backing’s mutex.
Errors
Same checked errors as Allocator::unmap, plus SynchronizationPoisoned.
Safety
Same mapped-byte and completion contract as Allocator::unmap.
mapped_pointer
Current mapping pointer for one allocation under this allocator’s lock.
Errors
Same errors as Allocator::mapped_pointer, plus SynchronizationPoisoned.
flush
Run Allocator::flush under this allocator’s lock.
Errors
Same checked/native errors as Allocator::flush, plus SynchronizationPoisoned.
Safety
Same cache-range and completion contract as Allocator::flush.
invalidate
Run Allocator::invalidate under this allocator’s lock.
Errors
Same checked/native errors as Allocator::invalidate, plus SynchronizationPoisoned.
Safety
Same cache-range and completion contract as Allocator::invalidate.
flush_many
Run Allocator::flush_many under this allocator’s lock.
Errors
Same checked/native errors as Allocator::flush_many, plus SynchronizationPoisoned.
Safety
Same cache-range contract as Allocator::flush_many.
invalidate_many
Run Allocator::invalidate_many under this allocator’s lock.
Errors
Same checked/native errors as Allocator::invalidate_many, plus SynchronizationPoisoned.
Safety
Same cache-range contract as Allocator::invalidate_many.
set_heap_limit
Run Allocator::set_heap_limit under this allocator’s lock.
Errors
Same errors as Allocator::set_heap_limit, plus SynchronizationPoisoned.
budget_snapshot
Cached budget snapshot under this allocator’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
query_budget
Run Allocator::query_budget under this allocator’s lock.
Errors
Same errors as Allocator::query_budget, plus SynchronizationPoisoned.
Safety
Same instance/physical-device and PFN contract as Allocator::query_budget.
refresh_budget
Run Allocator::refresh_budget under this allocator’s lock.
Errors
Same errors as Allocator::refresh_budget, plus SynchronizationPoisoned.
refresh_budget_with_context
Run Allocator::refresh_budget_with_context under this allocator’s lock.
Errors
Same errors as Allocator::refresh_budget_with_context, plus SynchronizationPoisoned.
Safety
Same context/PFN contract as Allocator::refresh_budget_with_context.
heap_budgets
Run Allocator::heap_budgets under this allocator’s lock.
Errors
Same errors as Allocator::heap_budgets, plus SynchronizationPoisoned.
set_current_frame_index
Run Allocator::set_current_frame_index under this allocator’s lock.
Errors
Same errors as Allocator::set_current_frame_index, plus SynchronizationPoisoned.
current_frame_index
Current frame index under this allocator’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
trim
Run Allocator::trim under this allocator’s lock.
Errors
Same errors as Allocator::trim, plus SynchronizationPoisoned.
trim_with_budget
Run Allocator::trim_with_budget under this allocator’s lock.
Errors
Same errors as Allocator::trim_with_budget, plus SynchronizationPoisoned.
Safety
Same instance/physical-device and PFN contract as Allocator::trim_with_budget.
create_pool
Run Allocator::create_pool under this allocator’s lock.
Errors
Same checked/native errors as Allocator::create_pool, plus SynchronizationPoisoned.
Safety
Same policy/storage contract as Allocator::create_pool.
create_pool_with_chain
Run Allocator::create_pool_with_chain under this allocator’s lock.
Errors
Same checked/native errors as Allocator::create_pool_with_chain, plus SynchronizationPoisoned.
Safety
Same retained-chain contract as Allocator::create_pool_with_chain;
the chain must also satisfy SynchronizedAllocator::new’s any-thread rules.
destroy_pool
Run Allocator::destroy_pool under this allocator’s lock.
Errors
Same live-resource errors as Allocator::destroy_pool, plus SynchronizationPoisoned.
pool_statistics
One pool’s statistics under this allocator’s lock.
Errors
Same errors as Allocator::pool_statistics, plus SynchronizationPoisoned.
set_pool_name
Run Allocator::set_pool_name under this allocator’s lock.
Errors
Same errors as Allocator::set_pool_name, plus SynchronizationPoisoned.
set_preferred_block_size
Run Allocator::set_preferred_block_size under this allocator’s lock.
Errors
Same errors as Allocator::set_preferred_block_size, plus SynchronizationPoisoned.
set_mapping_hysteresis
Run Allocator::set_mapping_hysteresis under this allocator’s lock.
Errors
Same errors as Allocator::set_mapping_hysteresis, plus SynchronizationPoisoned.
detailed_statistics
Aggregate memory statistics under this allocator’s lock.
Errors
Same errors as Allocator::detailed_statistics, plus SynchronizationPoisoned.
detailed_pool_statistics
One pool’s detailed statistics under this allocator’s lock.
Errors
Same errors as Allocator::detailed_pool_statistics, plus SynchronizationPoisoned.
write_statistics_json
Run Allocator::write_statistics_json under this allocator’s lock.
Errors
Same errors as Allocator::write_statistics_json, plus SynchronizationPoisoned.
set_debug_memory_settings
Run Allocator::set_debug_memory_settings under this allocator’s lock.
Errors
Same errors as Allocator::set_debug_memory_settings, plus SynchronizationPoisoned.
check_corruption
Run Allocator::check_corruption under this allocator’s lock.
Errors
Same checked errors as Allocator::check_corruption, plus SynchronizationPoisoned.
Safety
Same guard-pattern byte-validity contract as Allocator::check_corruption.
check_pool_corruption
Run Allocator::check_pool_corruption under this allocator’s lock.
Errors
Same checked errors as Allocator::check_pool_corruption, plus SynchronizationPoisoned.
Safety
Same guard-pattern byte-validity contract as Allocator::check_pool_corruption.
set_external_memory_types
Run Allocator::set_external_memory_types under this allocator’s lock.
Errors
Same errors as Allocator::set_external_memory_types, plus SynchronizationPoisoned.
Safety
Same capability/creation contract as Allocator::set_external_memory_types.
external_memory_types
One allocation’s external handle types under this allocator’s lock.
Errors
Same errors as Allocator::external_memory_types, plus SynchronizationPoisoned.
get_memory_fd
Run Allocator::get_memory_fd under this allocator’s lock.
Errors
Same checked/native errors as Allocator::get_memory_fd, plus SynchronizationPoisoned.
Safety
Same external-memory and descriptor-ownership contract as Allocator::get_memory_fd.
set_device_memory_callbacks
Run Allocator::set_device_memory_callbacks under this allocator’s lock.
Errors
Same errors as Allocator::set_device_memory_callbacks, plus SynchronizationPoisoned.
Safety
Same retained-callback contract as Allocator::set_device_memory_callbacks;
callbacks must also satisfy SynchronizedAllocator::new’s any-thread rules.
new
Adopt one allocator for synchronized access from any host thread. No native operation, allocation, mapping or thread is started.
Safety
Every retained callback record/code/user datum, pool allocation chain and nested external reference must remain valid for the device borrow and support access on any participating thread, including final CPU cleanup. Retained records must be immutable across threads; callback-owned mutable state needs its own synchronization when shared with independent owners. Existing mapped-byte uses must be synchronized against subsequent operations. Native contexts must meet Vulkan’s host-thread lifetime/valid-usage contract. No callback may unwind or reenter this same allocator.
new_owned
Adopt one device-retained allocator for synchronized access from any
host thread. Every retained reference is owned or 'static, so the
unsafe contract of Self::new is satisfied by construction; the
remaining caller obligations are the documented host-thread,
non-reentrancy and mapped-byte synchronization rules.
with_allocator
Run one operation/batch with exclusive access to the canonical allocator. The borrow cannot escape the closure. Returned tokens/handles remain raw native identities; no lock covers their later GPU or mapped-byte uses.
Errors
Returns SynchronizationPoisoned without running the closure after a panic. Operation errors remain the closure’s result and do not poison the mutex.
Panics
A closure panic propagates and poisons subsequent access. Reentrant use of this same allocator can deadlock and violates the unsafe access contract.
Safety
Preserve new’s any-thread contract for every retained registration/state change. Do not replace the allocator with thread-affine state. All native operation/callback/completion rules apply. Inside any partitioned scope, never move out or replace the borrowed child allocator. Synchronize any escaping mapped pointer before unmap/free/relocation; the mutex protects metadata only.
try_with_allocator
Attempt one exclusive operation without waiting for another host user.
None means busy; poison is an error and never bypassed.
Errors
Same poison refusal as with_allocator; operation failures stay in R.
Safety
The complete with_allocator contract applies, including any-thread retained state, callback non-reentrancy and synchronization of escaping mappings.
with_pools
Run independent custom pools concurrently through borrowed child owners.
Children correspond to pools in input order, preserve allocation/pool
identities and use the same canonical methods through with_allocator.
Each child serializes its own pool; different pools can execute native
operations concurrently, even on the same memory type. A shared reservation
lock enforces aggregate native-count, heap and within-budget limits, but
never covers native PFNs. The parent remains locked for the whole scope.
Its ordinary operations, statistics and relocation resume after restoration.
All scope metadata uses the allocator’s CPU callbacks. Merge capacity is reserved before native effects; scope exit and panic restoration allocate no host memory and perform no native cleanup. Existing mappings remain live. Budget pressure is sampled at entry and corrected for all local reservations through this batch; split long-lived workloads into bounded scopes to refresh.
// SAFETY: all retained references/callbacks support concurrent workers;
// this batch installs no thread-affine state and leaves native cleanup explicit.
unsafe { shared.with_pools(&[first, second], |children| {
std::thread::scope(|scope| {
for (child, pool) in children.iter().zip([first, second]) {
scope.spawn(move || child.with_allocator(|allocator| {
allocator.pool_statistics(pool)
}).unwrap().unwrap());
}
});
})?; }Errors
Rejects foreign/stale/duplicate pools, nested pool scopes, preparation OOM, and poisoned access. A child panic poisons the parent even if caught by the operation. Cached export-root ownership follows its backing memory across the scope.
Safety
The complete with_allocator contract applies to every child. Use only
its selected pool for allocations; allocator-wide changes are rejected.
Never replace, move out or retain a child’s allocator/context. All borrowed
workers must finish before returning; do not reenter the locked parent.
Synchronize shared callbacks/user data across pools. Mapped-byte and GPU
ownership/completion remain explicit, including after a worker panic.
with_memory_types
Run independent default memory-type vectors concurrently.
Children correspond to distinct native memory-type indices. They own only default storage of that type, including separate allocations and cached blocks; custom pools remain with the parent. Native type selection cannot escape its selected type. Tokens/maps and accounting retain parent identity.
// SAFETY: retained device/callback state supports these joined workers;
// no replacement, registration or mapped byte access occurs in this batch.
unsafe { shared.with_memory_types(&[0], |children| {
std::thread::scope(|scope| {
scope.spawn(|| children[0].with_allocator(|allocator| {
allocator.memory_type_properties(0)
}).unwrap().unwrap()).join().unwrap();
});
})?; }Errors
Rejects absent/duplicate types, nested scopes, poison and metadata OOM.
Safety
The complete with_pools worker/callback/native-lifetime contract applies.
Use default allocation policies, without a custom pool. Never move out or
replace child owners, reenter the parent or form cross-child lock cycles.
with_blocks
Run mapping/cache/binding work concurrently on distinct native blocks.
Each seed is a live allocation; seeds must select different backing memory objects. A child contains every live region on that backing object, including regions not used as seeds. Regions sharing a block share its one mutex/map count. Different blocks of one custom/default pool can progress independently. Allocation/free, pool changes, trim and relocation are excluded for this borrowed phase. Map holds, metadata, cached exports and original block order return to the parent, including after panic. No native cleanup occurs on exit. A child borrow cannot escape this phase:
ⓘlet child = unsafe { shared.with_blocks(&[seed], |children| &children[0]) };Errors
Rejects stale/foreign seeds, duplicate backings, nested scopes, poison and OOM.
Safety
The complete with_pools borrowing/any-thread/native contract applies.
Use each token only in its matching child. No worker/reference may escape;
synchronize mapped bytes and external object uses, and avoid lock cycles.
statistics
Observe a serialized allocator-owned statistics snapshot.
Errors
Returns SynchronizationPoisoned after a closure panic.
into_inner
Recover the exclusive allocator without performing native cleanup.
Errors
PoisonError retains the allocator for deliberate inspection/recovery using into_inner; do not assume panic-interrupted native transactions completed.
Stvk::mem::SynchronizedVirtualBlock
Contract
One virtual block with serialized operation access from any host thread.
Default-constructed blocks allocate metadata with the system allocator and
are safe to share immediately. Callback-backed blocks are adopted through
unsafe constructors under the same any-thread contract as VirtualBlock’s
unsafe callback construction. Access serializes per block; independent
blocks run concurrently. There is no GPU or native completion tracking.
Caller-provided diagnostic writers must not reenter this block.
Methods and associated items
new
Create TLSF host-only placement behind one mutex. No callbacks are borrowed.
Errors
Rejects a zero size or failed host metadata reservation.
new_with_algorithm
Create TLSF or linear host-only placement behind one mutex.
Errors
Rejects a zero size or failed host metadata reservation.
new_with_callbacks
Create callback-backed placement behind one mutex.
Errors
Same errors as VirtualBlock::new_with_callbacks.
Safety
The complete VirtualBlock::new_with_callbacks contract applies. Callback
code and user data additionally must support calls on any participating
worker thread, not only the constructing thread, through final cleanup.
new_from_block
Adopt an existing block for serialized access from any host thread.
Safety
If the block borrows allocation callbacks, their records/code/user data
must satisfy VirtualBlock::new_with_callbacks’s contract and support
calls on any participating worker thread through final cleanup.
allocate
Run VirtualBlock::allocate under this block’s lock.
Errors
Same errors as VirtualBlock::allocate, plus SynchronizationPoisoned.
allocate_upper
Run VirtualBlock::allocate_upper under this block’s lock.
Errors
Same errors as VirtualBlock::allocate_upper, plus SynchronizationPoisoned.
free
Run VirtualBlock::free under this block’s lock.
Errors
Same errors as VirtualBlock::free, plus SynchronizationPoisoned.
allocation_info
Run VirtualBlock::allocation_info under this block’s lock.
Errors
Same errors as VirtualBlock::allocation_info, plus SynchronizationPoisoned.
set_user_data
Run VirtualBlock::set_user_data under this block’s lock.
Errors
Same errors as VirtualBlock::set_user_data, plus SynchronizationPoisoned.
is_empty
Run VirtualBlock::is_empty under this block’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
clear
Run VirtualBlock::clear under this block’s lock.
Users of previously returned offsets must stop using them before reuse.
Errors
Returns SynchronizationPoisoned after a closure panic.
statistics
Run VirtualBlock::statistics under this block’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
detailed_statistics
Run VirtualBlock::detailed_statistics under this block’s lock.
Errors
Returns SynchronizationPoisoned after a closure panic.
write_statistics_json
Run VirtualBlock::write_statistics_json under this block’s lock.
Errors
Same errors as VirtualBlock::write_statistics_json, plus SynchronizationPoisoned.
Panics
A writer panic propagates and poisons subsequent operations. Writers must not reenter the block while this method holds its lock.
into_inner
Recover the exclusive block without native cleanup.
Errors
PoisonError retains the block for explicit inspection/cleanup after a panic.