bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ftw/nftw is limited by stack size


From: Jim Meyering
Subject: Re: ftw/nftw is limited by stack size
Date: Fri, 17 Jan 2003 17:56:47 +0100

Ulrich Drepper <address@hidden> wrote:
> Jim Meyering wrote:
>
>> What do you think about rewriting it to use space on the heap
>> rather than on the stack?
>
> It makes the general case slower for the few lunatics with such
> filesystem hierachies.  That's absolutely not desirable.

Hi Uli,

Are you sure it'd make a significant difference in performance?
I want a portable version of ftw that is immune to such abuse,
and am willing to incur a reasonable performance penalty, so I'll
probably implement it and make du use the more robust version.

> Instead you could work around the problem (for some platforms) by using
> not the normal stack, but instead some allocated memory.
>
> use mmap() to allocate many many megabytes of memory (maybe even you the
> automatic-grow feature Linux provides, although this might also be
> limited by the stack size).  This won't actually require any physical
> memory.  Then use makecontext and setcontext to use this memory.

Yes, but should every application that uses ftw -- and that wants
to avoid that limitation -- have to go to such lengths?

Jim

Attachment: pgpnK9eurFqix.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]