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.
This commit is contained in:
Daniel Stenberg
2015-05-12 09:46:53 +02:00
parent d37e0160c2
commit b419e7ae0c
10 changed files with 31 additions and 82 deletions

View File

@@ -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);
}
/*