cURL / Mailing Lists / curl-library / Single Mail


Re: stack overflow

From: T. Bharath <>
Date: Tue, 11 Sep 2001 02:50:29 -0400

Iam still poking around
So far i found that Transfer() has a buffer, scratch of size 1024*50*2 (100k).
In the UrlState struct there is a buffer of size (1024*50 + 1) (50k)
I think these are the main culprits.
Daniel Stenberg wrote:

> On Tue, 11 Sep 2001, T. Bharath wrote:
> > The curllib uses large stack based buffers some of even 8k size.Now the
> > advantage is that we dont need to worry about deallocating them and no
> > memory leaks
> It is also usually much faster. Do you have any profiling data that points to
> where the biggest sinners are? I mean which functions.
> > Do you think Curl should use heapbased buffers and not stackbuffers
> I think curl should use a malloc() to alloc memory chunks that are "large".
> Only "small" memory buffers should be stack based.
> --
> Daniel Stenberg -- curl groks URLs --
Received on 2001-09-11