[PATCH] __libc_alloca_cutoff (aka make mysql and others apps with very low RLIMIT_STACK setting happy)

Ulrich Drepper drepper@redhat.com
Tue Oct 8 00:21:00 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roland McGrath wrote:

> Conversely instead of a variable we could have a function that's given the
> size and returns whether to use alloca or malloc.

The variable should definitely not be exported.  We should always only
use functions.


> The libc version can
> just say to always use alloca, I don't care about supporting tiny
> RLIMIT_STACK values for single-threaded programs.

Sure.  It always worked.



> The libpthread version
> can look at the thread's stack size vs the allocation, and perhaps even
> look at the current stack depth.

Yep.  We have the stack size in the thread descriptor anyway so in fact
we have the thread-local variable.


> Then we don't have to diddle setrlimit
> and all the rest, or add the word of TLS data

setrlimit is out anyway.  I'm not using it in nptl at all.


- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9omJM2ijCOnn/RHQRAiidAJwMDY/gohRR4oUMdJmUDg9TzmcWhwCfVtYJ
wJ9vAbZJfyii6TbCBU7uOE8=
=OzH7
-----END PGP SIGNATURE-----



More information about the Libc-hacker mailing list