summaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-05-12 09:46:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-12 09:46:53 +0200
commitb419e7ae0c9869ac3eb06d529efeb2c6dc1b4bc1 (patch)
tree6938b33aaf767e9006ce881bd707651b10cc946a /lib/hostip.c
parentd37e0160c2eb22c616ae3ff25c03c3b4711b2a13 (diff)
downloadcurl-b419e7ae0c9869ac3eb06d529efeb2c6dc1b4bc1.tar.gz
hostcache: made all host caches use structs, not pointers
This avoids unnecessary dynamic allocs and as this also removed the last users of *hash_alloc() and *hash_destroy(), those two functions are now removed.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 764e78026..338cf2de6 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -742,11 +742,12 @@ static void freednsentry(void *freethis)
}
/*
- * Curl_mk_dnscache() creates a new DNS cache and returns the handle for it.
+ * Curl_mk_dnscache() inits a new DNS cache and returns success/failure.
*/
-struct curl_hash *Curl_mk_dnscache(void)
+int Curl_mk_dnscache(struct curl_hash *hash)
{
- return Curl_hash_alloc(7, Curl_hash_str, Curl_str_key_compare, freednsentry);
+ return Curl_hash_init(hash, 7, Curl_hash_str, Curl_str_key_compare,
+ freednsentry);
}
/*