[][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

Allocator

Allocator that needs to be installed.

Events

A fixed-size collection of allocations.

Machine

Fake machine implementation to validate an allocation history.

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.

Enums

Event

Metadata for a single allocation or deallocation.

Constants

STATE

Thread-local state required by the allocator.