From 642067287931da64e485e402e5e1fa5096abcddd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 26 Apr 2013 22:23:08 +0200 Subject: curl_easy_init: use less mallocs By introducing an internal alternative to curl_multi_init() that accepts parameters to set the hash sizes, easy handles will now use tiny socket and connection hash tables since it will only ever add a single easy handle to that multi handle. This decreased the number mallocs in test 40 (which is a rather simple and typical easy interface use case) from 1142 to 138. The maximum amount of memory allocated used went down from 118969 to 78805. --- lib/conncache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/conncache.h') diff --git a/lib/conncache.h b/lib/conncache.h index fad17d8f7..f5e41f187 100644 --- a/lib/conncache.h +++ b/lib/conncache.h @@ -27,7 +27,7 @@ struct conncache { size_t num_connections; }; -struct conncache *Curl_conncache_init(void); +struct conncache *Curl_conncache_init(int size); void Curl_conncache_destroy(struct conncache *connc); -- cgit v1.2.1