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.
MaybeAllocis an implementation for
GlobalAlloc, which occasionally fails to allocate.
NeverAllocis an implementation for
GlobalAlloc, which always fails. For example,
NeverAlloc::allocalways returns a null pointer.
TestAllocis a implementation for
GlobalAllocto test memory leak and so on.
std::boxed::Boxexcept for it owns a reference to a