This is the mail archive of the gdb@sources.redhat.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: [RFA] alloca coding standard


> Date: Mon, 13 Nov 2000 01:54:45 -0500
> From: Nick Duffek <nsd@redhat.com>
>
> 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.

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