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 MaybeAlloc
is an implementation forGlobalAlloc
, which occasionally fails to allocate.- Never
Alloc NeverAlloc
is an implementation forGlobalAlloc
, which always fails. For example,NeverAlloc::alloc
always returns a null pointer.- Test
Alloc TestAlloc
is a implementation forGlobalAlloc
to test memory leak and so on.- TestBox
TestBox
behaves likestd::boxed::Box
except for it owns a reference to aGlobalAlloc
.