diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-01-11 14:11:13 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-01-11 17:50:27 +0000 |
commit | e6b5c341b94d357b0158ad74b12edd51399a4b87 (patch) | |
tree | 0957d4adb18236b4f70e0edf836023d7b39a0d23 /crypto/mem_dbg.c | |
parent | 8e423bde2561bcddbc1d67f1fcc182d7dfa3f04d (diff) |
Inline LHASH_OF
Make LHASH_OF use static inline functions.
Add new lh_get_down_load and lh_set_down_load functions and their
typesafe inline equivalents.
Make lh_error a function instead of a macro.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r-- | crypto/mem_dbg.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index 6e93c8047e..36ce5f4eb4 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -139,10 +139,6 @@ static int mh_mode = CRYPTO_MEM_CHECK_OFF; #ifndef OPENSSL_NO_CRYPTO_MDEBUG static unsigned long order = 0; /* number of memory requests */ -DECLARE_LHASH_OF(MEM); -static LHASH_OF(MEM) *mh = NULL; /* hash-table of memory requests (address as - * key); access requires MALLOC2 lock */ - /*- * For application-defined information (static C-string `info') * to be displayed in memory leak list. @@ -150,25 +146,24 @@ static LHASH_OF(MEM) *mh = NULL; /* hash-table of memory requests (address as * OPENSSL_mem_debug_push("...") to push an entry, * OPENSSL_mem_debug_pop() to pop an entry, */ -typedef struct app_mem_info_st { +struct app_mem_info_st { CRYPTO_THREADID threadid; const char *file; int line; const char *info; struct app_mem_info_st *next; /* tail of thread's stack */ int references; -} APP_INFO; +}; /* * hash-table with those app_mem_info_st's that are at the * top of their thread's stack (with `thread' as key); access requires * MALLOC2 lock */ -DECLARE_LHASH_OF(APP_INFO); static LHASH_OF(APP_INFO) *amih = NULL; /* memory-block description */ -typedef struct mem_st { +struct mem_st { void *addr; int num; const char *file; @@ -181,7 +176,10 @@ typedef struct mem_st { void *array[30]; size_t array_siz; #endif -} MEM; +}; + +static LHASH_OF(MEM) *mh = NULL; /* hash-table of memory requests (address as + * key); access requires MALLOC2 lock */ /* num_disable > 0 iff mh_mode == CRYPTO_MEM_CHECK_ON (w/o ..._ENABLE) */ static unsigned int num_disable = 0; |