Adds a basic memory test on the used memory buffers.

This commit is contained in:
Andrea Mazzoleni 2013-10-27 17:31:10 +01:00
parent e7804a5f8f
commit 7414f8daec
8 changed files with 67 additions and 0 deletions

6
util.h
View file

@ -464,6 +464,12 @@ void* malloc_nofail_align(size_t size, void** freeptr);
*/
unsigned char** malloc_nofail_vector_align(size_t count, size_t size, void** freeptr);
/**
* Test the memory vector for RAM problems.
* If a problem is found, it crashes.
*/
void mtest_vector(unsigned char** buf, size_t count, size_t size);
/**
* Safe strdup.
* If no memory is available, it aborts.