Expand description
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§
- Maybe
Alloc MaybeAllocis an implementation forGlobalAlloc, which occasionally fails to allocate.- Never
Alloc NeverAllocis an implementation forGlobalAlloc, which always fails. For example,NeverAlloc::allocalways returns a null pointer.- Test
Alloc TestAllocis a implementation forGlobalAllocto test memory leak and so on.- TestBox
TestBoxbehaves likestd::boxed::Boxexcept for it owns a reference to aGlobalAlloc.