diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-04-20 15:10:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-04-20 17:26:49 +0200 |
commit | a4494df7059796a5066858b7ba3be542e1f8b308 (patch) | |
tree | 5ce9ce842c49419d3372d6b84400e6c8f2154b11 /lib/llist.h | |
parent | da2af5c04dee9d0e16c02b468494f386ac69e837 (diff) | |
download | curl-a4494df7059796a5066858b7ba3be542e1f8b308.tar.gz |
llist: no longer uses mallocbagder/llist-less-malloc
The 'list element' struct now has to be a struct within the data that
struct itself that is being held in the list. Removes 16.6% (tiny)
mallocs from a simple HTTP transfer. (96 => 80)
Also removed return codes since the llist functions can't fail now.
Test 1300 updated accordingly.
Diffstat (limited to 'lib/llist.h')
-rw-r--r-- | lib/llist.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/llist.h b/lib/llist.h index 47935ad1f..6b644b99c 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -29,7 +29,6 @@ typedef void (*curl_llist_dtor)(void *, void *); struct curl_llist_element { void *ptr; - struct curl_llist_element *prev; struct curl_llist_element *next; }; @@ -37,21 +36,19 @@ struct curl_llist_element { struct curl_llist { struct curl_llist_element *head; struct curl_llist_element *tail; - curl_llist_dtor dtor; - size_t size; }; void Curl_llist_init(struct curl_llist *, curl_llist_dtor); -int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, - const void *); -int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, - void *); +void Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *, + const void *, struct curl_llist_element *node); +void Curl_llist_remove(struct curl_llist *, struct curl_llist_element *, + void *); size_t Curl_llist_count(struct curl_llist *); void Curl_llist_destroy(struct curl_llist *, void *); -int Curl_llist_move(struct curl_llist *, struct curl_llist_element *, - struct curl_llist *, struct curl_llist_element *); +void Curl_llist_move(struct curl_llist *, struct curl_llist_element *, + struct curl_llist *, struct curl_llist_element *); #endif /* HEADER_CURL_LLIST_H */ |