From 18c1bfafe0ccdd3229d91bbb07ed942e9f233f93 Mon Sep 17 00:00:00 2001 From: Eugene Uriev Date: Sun, 31 Mar 2024 23:03:24 +0300 Subject: 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 --- include/mcheck.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/mcheck.h b/include/mcheck.h index a049745e4e3..f4c9b7e61c8 100644 --- a/include/mcheck.h +++ b/include/mcheck.h @@ -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. -- cgit v1.2.3