mcheck: add pedantic mode support

The pedantic mode is run-time contolled, so
appropriate registry take place everytime.

Maybe it's worth to use compile-time control only.
So, the registry could be optimized out by an #ifdef.

Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
This commit is contained in:
Eugene Uriev
2024-03-31 23:03:24 +03:00
committed by Tom Rini
parent ae838768d7
commit 18c1bfafe0
3 changed files with 62 additions and 0 deletions

View File

@@ -33,6 +33,15 @@ typedef void (*mcheck_abortfunc_t)(enum mcheck_status);
int mcheck(mcheck_abortfunc_t func);
/*
* Similar to `mcheck' but performs checks for all block whenever one of
* the memory handling functions is called. This can be very slow.
*/
int mcheck_pedantic(mcheck_abortfunc_t f);
/* Force check of all blocks now. */
void mcheck_check_all(void);
/*
* Check for aberrations in a particular malloc'd block. These are the
* same checks that `mcheck' does, when you free or reallocate a block.