[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ftw/nftw is limited by stack size
From: |
Ulrich Drepper |
Subject: |
Re: ftw/nftw is limited by stack size |
Date: |
Fri, 17 Jan 2003 10:49:34 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030115 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
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.
- --
- --------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+J9++2ijCOnn/RHQRAljFAJ4x/RxSYOl6pdqwnV8mKn8cBe8PkQCglQNw
683xNPa6HrdfEJwObDGXVqw=
=O55R
-----END PGP SIGNATURE-----