This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Remote protocol tune up...


> regard to ``(256*1024)'', foke law has it that some hosts do not handle
> alloca()s larger than 64k.  If you're going to allow large transfers
> then it will need to avoid alloca().''

Alloca really should not be used for stuff that is going to get arbitrarily
large. Many people have their stacksize limit at 8 megs or so, and some of
the NetBSD ports (arm32, pc532, vax) have their default hard limit set at
8 megs also. (Not sure why they felt it necessary to do this; it may have
been an attempt to avoid something nasty in the VM hardware.)

It has been noted that linking large programs (think mozilla) can cause GNU
ld to alloca() quite a bit, ultimately using more than 8 megs of stack.

<soapbox>
I recall being repulsed by the concept of alloca() when I first heard of it.
It really is a gruesome hack just to avoid leaking memory when you get an
error. But if you have any other kind of cleanup to do, alloca() is no help.
</soapbox>

-- 
Todd Whitesel
toddpw @ wrs.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]