[−][src]Crate checkers
Checkers is a simple allocation checker for Rust that runs purely inside of Rust.
Examples
You use checkers by installing it's allocator, then making use of
checkers::with!
.
#[global_allocator] static CHECKED: checkers::Allocator = checkers::Allocator; #[test] fn test_allocations() { checkers::with!(|| { let mut bytes = vec![10, 20, 30]; bytes.truncate(2); }); }
Macros
verify | Verify the state of the allocator. |
with | Run the given function inside of the allocation checker. |
Structs
AllocationMeta | Metadata for a single allocation or deallocation. |
Allocations | A fixed-size collection of allocations. |
Allocator | Allocator that needs to be installed. |
Pointer | A type-erased pointer. The inner representation is specifically not a raw pointer to avoid aliasing the pointers handled by the allocator. |
ThreadLocalState | Structure containing all thread-local state required to use the single-threaded allocation checker. |
Constants
STATE | Thread-local state required by the allocator. |