Bruno Haible <[EMAIL PROTECTED]> writes: > Are there no comments regarding > http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00333.html ? > This is code that should fix a problem also in glibc.
I haven't had time to review it well but the basic idea seems fine. While we're on the subject in my own code I've been more and more leaning against the use of alloca, and simply using a local array of size 8000 bytes, falling back on malloc if we need more memory. If code isn't recursive, I suspect this is just as good as alloca on modern architectures, and maybe even a bit faster on some like the POWER architecture; it's certainly less of a hassle to port. (I admit I haven't measured the performance, though.) But I guess fnmatch is recursive, no? So perhaps using alloca is still justifiable there, to save memory. (Can you tell that I haven't read the fnmatch code lately? :-)