cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libcurl - why curl require 64k stack size?

From: Gary Maxwell <gmaxwell_at_casabi.com>
Date: Fri, 18 Apr 2008 10:25:14 -0700

Jamie Lokier wrote:
>
> Dan Fandrich wrote:
> > On Fri, Apr 18, 2008 at 02:45:50PM +0200, Daniel Stenberg wrote:
> > > On Fri, 18 Apr 2008, Abhishek Srivastava wrote:
> > >> I was wondering why curl require 64k stack size?
> > >
> > > Me too.
> >
> > The --manual decompressor uses a 64k decompression buffer located on
> > the stack. That's easy to move to the heap.
>
> Thanks for mentioning it. Is there anything else?
>
> I'm using curl/libcurl on a small device, and we have to allocate the
> stack with a fixed size. There's no memory protection, so overflow is
> bad. We allocate 32kiB stack at the moment, for no particular reason.
>

Check out this thread from the mailing list regarding mprintf:
http://curl.haxx.se/mail/lib-2006-07/0259.html

We're running libcurl on a thread on ARM7 RTOS platform with less than
4KByte stack, including HTTPS transactions using axTLS. We're running
with our private patch to the mprintf module (follow the mail archive
thread for the patch). I've been too lazy to build and submit a cleaner
patch which doesn't make as many calls into malloc/free.

-Gary Maxwell
Received on 2008-04-18