summaryrefslogtreecommitdiffstats
path: root/crypto/mem_dbg.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-12-24 16:51:23 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-01-11 18:50:27 +0100
commit62d0577e0d5e3703436d0fba362d516481291810 (patch)
tree5298b79f976f3264b244acba116fcdfbc8172a93 /crypto/mem_dbg.c
parentInline LHASH_OF (diff)
downloadopenssl-62d0577e0d5e3703436d0fba362d516481291810.tar.xz
openssl-62d0577e0d5e3703436d0fba362d516481291810.zip
Add lh_new() inlining
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r--crypto/mem_dbg.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 36ce5f4eb4..2bdfbffba2 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -306,8 +306,6 @@ static int mem_cmp(const MEM *a, const MEM *b)
#endif
}
-static IMPLEMENT_LHASH_COMP_FN(mem, MEM)
-
static unsigned long mem_hash(const MEM *a)
{
size_t ret;
@@ -318,17 +316,11 @@ static unsigned long mem_hash(const MEM *a)
return (ret);
}
-static IMPLEMENT_LHASH_HASH_FN(mem, MEM)
-
-/* static int app_info_cmp(APP_INFO *a, APP_INFO *b) */
-static int app_info_cmp(const void *a_void, const void *b_void)
+static int app_info_cmp(const APP_INFO *a, const APP_INFO *b)
{
- return CRYPTO_THREADID_cmp(&((const APP_INFO *)a_void)->threadid,
- &((const APP_INFO *)b_void)->threadid);
+ return CRYPTO_THREADID_cmp(&a->threadid, &b->threadid);
}
-static IMPLEMENT_LHASH_COMP_FN(app_info, APP_INFO)
-
static unsigned long app_info_hash(const APP_INFO *a)
{
unsigned long ret;
@@ -339,8 +331,6 @@ static unsigned long app_info_hash(const APP_INFO *a)
return (ret);
}
-static IMPLEMENT_LHASH_HASH_FN(app_info, APP_INFO)
-
static APP_INFO *pop_info(void)
{
APP_INFO tmp;
@@ -377,7 +367,7 @@ int CRYPTO_mem_debug_push(const char *info, const char *file, int line)
if ((ami = OPENSSL_malloc(sizeof(*ami))) == NULL)
goto err;
if (amih == NULL) {
- if ((amih = lh_APP_INFO_new()) == NULL) {
+ if ((amih = lh_APP_INFO_new(app_info_hash, app_info_cmp)) == NULL) {
OPENSSL_free(ami);
goto err;
}
@@ -435,7 +425,7 @@ void CRYPTO_mem_debug_malloc(void *addr, size_t num, int before_p,
return;
}
if (mh == NULL) {
- if ((mh = lh_MEM_new()) == NULL) {
+ if ((mh = lh_MEM_new(mem_hash, mem_cmp)) == NULL) {
OPENSSL_free(addr);
OPENSSL_free(m);
addr = NULL;