Add lh_new() inlining
Reviewed-by: Rich Salz <rsalz@openssl.org>
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 36ce5f4..2bdfbff 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -306,8 +306,6 @@
#endif
}
-static IMPLEMENT_LHASH_COMP_FN(mem, MEM)
-
static unsigned long mem_hash(const MEM *a)
{
size_t ret;
@@ -318,17 +316,11 @@
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 @@
return (ret);
}
-static IMPLEMENT_LHASH_HASH_FN(app_info, APP_INFO)
-
static APP_INFO *pop_info(void)
{
APP_INFO tmp;
@@ -377,7 +367,7 @@
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 @@
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;