- Added more documentation in CHANGES.

- Made CRYPTO_MDEBUG even less used in crypto.h, giving
   MemCheck_start() and MemCheck_stop() only one possible definition.
 - Made the values of the debug function pointers in mem.c dependent
   on the existence of the CRYPTO_MDEBUG macro, and made the rest of
   the code understand the NULL case.

That's it.  With this code, the old behvior of the debug functionality
is restored, but you can still opt to have it on, even when the
library wasn't compiled with a defined CRYPTO_MDEBUG.
This commit is contained in:
Richard Levitte
1999-12-18 02:34:37 +00:00
parent d8df48a9bc
commit f3a2a04496
3 changed files with 60 additions and 24 deletions

View File

@@ -217,8 +217,8 @@ typedef struct crypto_ex_data_func_st
(void (*)())CRYPTO_dbg_realloc,\
(void (*)())CRYPTO_dbg_free,\
(void (*)())CRYPTO_dbg_set_options,\
(void (*)())CRYPTO_dbg_get_options);\
} while(0);
(int (*)())CRYPTO_dbg_get_options);\
} while(0)
#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
@@ -226,13 +226,8 @@ typedef struct crypto_ex_data_func_st
# endif
#endif
#ifdef CRYPTO_MDEBUG
#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
#else
#define MemCheck_start()
#define MemCheck_stop()
#endif
#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
#define is_MemCheck_on() CRYPTO_mem_check_on()