Module state_ptr

Module state_ptr 

Source
Expand description

This module provides a way to combine state with pointer into single value.

Size of the state is limited by the pointer alignment. PtrState combines pointer and state. It preserves pointer provenance and allows to use restored pointer safely under strict-provenance rules.

Structsยง

AtomicPtrState
Stores pointer and state in lower bits of single pointer value. State size is limited by pointer alignment.
PtrState
Stores pointer and state in lower bits of single pointer value. State size is limited by pointer alignment.
State
State wrapper for usize that ensures that address bits for pointer to T are not set.