aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-10 14:42:10 -0500
committerDr. Stephen Henson <steve@openssl.org>2016-01-11 02:41:16 +0000
commitc2e27310c790c0dd2f87dd420e65e0cca522ddb2 (patch)
treebda08e77fcbd3f993498ef5a4c7d9b551b0b47ed /include
parent3af45d9978c0bf6ce333e9666f41a03d41822d0c (diff)
downloadopenssl-c2e27310c790c0dd2f87dd420e65e0cca522ddb2.tar.gz
Enable/disable crypto-mdebug just like other features
Also always abort() on leak failure. Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'include')
-rw-r--r--include/openssl/crypto.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
index 2d1a98327a..5de0f504db 100644
--- a/include/openssl/crypto.h
+++ b/include/openssl/crypto.h
@@ -249,10 +249,10 @@ typedef struct {
* The following can be used to detect memory leaks in the library. If
* used, it turns on malloc checking
*/
-# define CRYPTO_MEM_CHECK_OFF 0x0
-# define CRYPTO_MEM_CHECK_ON 0x1
-# define CRYPTO_MEM_CHECK_ENABLE 0x2
-# define CRYPTO_MEM_CHECK_DISABLE 0x3
+# define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
+# define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
+# define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
+# define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
/* predec of the BIO type */
typedef struct bio_st BIO_dummy;
@@ -291,20 +291,9 @@ DEFINE_STACK_OF(void)
#define OPENSSL_malloc_init() \
CRYPTO_set_mem_functions(CRYPTO_malloc, CRYPTO_realloc, CRYPTO_free)
-/*
- * Set standard debugging functions (not done by default unless CRYPTO_MDEBUG
- * is defined)
- */
-# if defined(CRYPTO_MDEBUG_ABORT) && !defined(CRYPTO_MDEBUG)
-# define CRYPTO_MDEBUG
-# endif
-# ifndef CRYPTO_MDEBUG
-# define OPENSSL_NO_CRYPTO_MDEBUG
-# endif
-
int CRYPTO_mem_ctrl(int mode);
-# ifdef CRYPTO_MDEBUG
+# ifndef OPENSSL_NO_CRYPTO_MDEBUG
# define OPENSSL_malloc(num) \
CRYPTO_malloc(num, __FILE__, __LINE__)
# define OPENSSL_zalloc(num) \