[][src]Crate gharial

Gharial is a test tool for program to manipulate memory directly.

Rust usually follows the rule of RAII (Resource Acquisition is Initialization;) resources should be released on the drop, however, it is sometimes difficult to design low level code like that.

Container object, for example, sometimes allocates heap memory and build elements there. Then, the programmer could have to drop the elements and deallocate the heap manully; otherwise some trouble like memory leak could be occurred.

Gharial helps to test such program.

Structs

MaybeAlloc

MaybeAlloc is an implementation for GlobalAlloc , which occasionally fails to allocate.

NeverAlloc

NeverAlloc is an implementation for GlobalAlloc , which always fails. For example, NeverAlloc::alloc always returns a null pointer.

TestAlloc

TestAlloc is a implementation for GlobalAlloc to test memory leak and so on.

TestBox

TestBox behaves like std::boxed::Box except for it owns a reference to a GlobalAlloc .

Type Definitions

GAlloc

Alias to TestAlloc<System> . 'GAlloc' stands for Gharial Alloc

GBox

Alias to TestBox<T, GAlloc> 'GBox' stands for 'Gharial Box'.