diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-04-20 15:10:04 +0200 |
---|---|---|
committer | ng0 <ng0@infotropique.org> | 2017-08-22 15:24:23 +0000 |
commit | b060ebb3e358793959d23c5b906d707f585a8637 (patch) | |
tree | b0068150798e62afe7753c3a1f4d4b3fd841872a /lib/fileinfo.h | |
parent | dfdb7e1d446aeb8c21e07cdce1c6c45e272178be (diff) | |
download | gnurl-b060ebb3e358793959d23c5b906d707f585a8637.tar.gz gnurl-b060ebb3e358793959d23c5b906d707f585a8637.tar.bz2 gnurl-b060ebb3e358793959d23c5b906d707f585a8637.zip |
llist: no longer uses malloc
The 'list element' struct now has to be within the data that is being
added to 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.
Closes #1435
Diffstat (limited to 'lib/fileinfo.h')
-rw-r--r-- | lib/fileinfo.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/fileinfo.h b/lib/fileinfo.h index 5324f1a40..c5d0ee5b6 100644 --- a/lib/fileinfo.h +++ b/lib/fileinfo.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2010, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2010, 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,11 +23,15 @@ ***************************************************************************/ #include <curl/curl.h> +#include "llist.h" -struct curl_fileinfo *Curl_fileinfo_alloc(void); +struct fileinfo { + struct curl_fileinfo info; + struct curl_llist_element list; +}; -void Curl_fileinfo_dtor(void *, void *); +struct fileinfo *Curl_fileinfo_alloc(void); -struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src); +void Curl_fileinfo_dtor(void *, void *); #endif /* HEADER_CURL_FILEINFO_H */ |