curl-library
Re: Zero-copy interface
Date: Wed, 21 Jul 2010 11:21:23 +0200
On Die 20.07.2010 22:36, Daniel Stenberg wrote:
> On Mon, 19 Jul 2010, G Drukier wrote:
>
>> The way I've done this in the past is to have the code acquiring the
>> data, which in this case would be libcurl, assign an appropriate
>> block of memory itself for each incoming piece of data and pass that
>> on. The problem with that approach is knowing what allocator is being
>> used so that the buffer can be subsequently deallocated
>> properly. This problem is alleviated by your approach in which the
>> user allocates and provides the buffer.
>
> Yes, since the application knows how you want the data so it is way
> better if you allocate or by any other means provide the buffer. If
> libcurl would do that, you can bet that it won't be enough. An
> application could use mmap(), malloc(), alloca() or other
> ways. libcurl could not offer such fancy ways.
[snipp]
Sorry to interrupt, but I have a question yust for my curiosity.
Isn't possible to use the
http://curl.haxx.se/libcurl/c/curl_global_init_mem.html
as a possible start for a solution.
Maybe I'am wrong?
BR
Aleks
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-21