add MEM_SANITY_CHECK (behaves like MEMP_SANITY_CHECK) and ensure 'ram_end->prev' does not get changed

This commit is contained in:
goldsimon
2017-09-26 22:30:18 +02:00
parent a61aee337b
commit ad4358592a
2 changed files with 61 additions and 2 deletions

View File

@@ -295,6 +295,14 @@
#define MEMP_SANITY_CHECK 0
#endif
/**
* MEM_SANITY_CHECK==1: run a sanity check after each mem_free() to make
* sure that the linked list of heap elements is not corrupted.
*/
#if !defined MEM_SANITY_CHECK || defined __DOXYGEN__
#define MEM_SANITY_CHECK 0
#endif
/**
* MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
* of memory pools of various sizes. When mem_malloc is called, an element of