From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: nsd@redhat.com Cc: gdb@sources.redhat.com Subject: Re: [RFA] alloca coding standard Date: Mon, 13 Nov 2000 03:16:00 -0000 Message-id: <200011131116.GAA02191@indy.delorie.com> References: <3A0CE1DB.6F6B1E93@cygnus.com> <200011130654.eAD6sjV16467@rtl.cygnus.com> X-SW-Source: 2000-11/msg00119.html > Date: Mon, 13 Nov 2000 01:54:45 -0500 > From: Nick Duffek > > diff -up gdb/doc/gdbint.texinfo gdb/doc/gdbint.texinfo > --- gdb/doc/gdbint.texinfo Mon Nov 13 01:25:51 2000 > +++ gdb/doc/gdbint.texinfo Mon Nov 13 01:25:15 2000 > @@ -2854,6 +2854,24 @@ visible to random source files. I have a few minor comments (assuming that the idea is accepted and this text will be added to gdbint.texinfo): > +@subsection Alloca I suggest an index entry here, e.g. "@findex alloca usage". (Hmm, it looks like gdbint.texinfo doesn't print an index right now. I will fix that.) > +@code{alloca} may be used for allocating up to a page of stack memory > +per function call. I'd suggest to say how much is a "page", at least for a couple of popular architectures. Not everyone is privy to intimate details of system's memory allocation. > +garbage-collect freed space. As of this writing, @value{GDBN} calls > +@code{alloc (0)} once per user command and once per inferior wait. ^^^^^ This should be `alloca', not `alloc'. Finally, perhaps something should be said about functions that could potentially be called recursively, where care should be taken not to overflow the runtime stack, even if each invocation asks a single page.