public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@cygnus.com>
To: Fernando Nasser <fnasser@cygnus.com>
Cc: gdb@sources.redhat.com, Eli Zaretskii <eliz@is.elta.co.il>
Subject: Re: alloca is bad?
Date: Fri, 10 Nov 2000 09:05:00 -0000	[thread overview]
Message-ID: <20001110120544.43205@cse.cygnus.com> (raw)
In-Reply-To: <3A0C2588.89C2B603@cygnus.com>

On Fri, Nov 10, 2000 at 11:42:48AM -0500, Fernando Nasser wrote:
> Chris Faylor wrote:
> > 
> > On Fri, Nov 10, 2000 at 05:39:29AM -0500, Eli Zaretskii wrote:
> > >> Date: Thu, 9 Nov 2000 21:20:32 -0500
> > >> From: Christopher Faylor <cgf@redhat.com>
> > >>
> > >> I was surprised by this assertion and so I thought I'd ask for a
> > >> consensus here.  Should the use of alloca be deprecated in gdb?
> > >
> > >In my experience, there's nothing wrong with alloca as long as it is
> > >used for allocating small buffers.  The only consideration is that not
> > >every platform supports alloca.
> > 
> > But, since alloca is already entrenched in gdb and available in liberty
> > I don't think this is an issue, is it?
> > 
> 
> Warning: if the "liberty" alloca() is used a "alloca(0)" must be added to
> our interpreter's command loops or the garbage collection becomes somewhat
> random (it will only happen when you call alloca() for allocating some
> other stuff and will only clean what was allocated by code that executed on frames
> below the current stack position.
> 
> I think we have this bug when alloca() gets used right now.
> 
> (Nothing difficult, we just need to remember to do it)

Note, that liberty's alloca will only be used if the host compiler is not GCC,
which probably makes it even harder to remember to use....  BTW, there are
systems out there that even's liberty's alloca will not work on (due to either
using a cactus stack or allocating the stack in pieces from the heap).

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

  parent reply	other threads:[~2000-11-10  9:05 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-09 18:20 Christopher Faylor
2000-11-09 18:37 ` Michael Meissner
2000-11-09 19:22   ` Christopher Faylor
2000-11-09 20:57     ` Nick Duffek
2000-11-09 22:18       ` Andrew Cagney
2000-11-09 22:20         ` Christopher G. Faylor
2000-11-10  6:21           ` Jim Blandy
2000-11-10  8:27             ` Christopher Faylor
2000-11-10 22:13             ` Andrew Cagney
2000-11-10 23:34               ` Eli Zaretskii
2000-11-11  9:08               ` Nick Duffek
2000-11-11 11:37                 ` Fernando Nasser
2000-11-11 13:16                   ` Nick Duffek
2000-11-12 16:42               ` Michael Meissner
2000-11-12 22:49               ` [RFA] alloca coding standard Nick Duffek
2000-11-13  3:16                 ` Eli Zaretskii
2000-11-13  4:51                 ` Andrew Cagney
2000-11-13  8:45                   ` [RFA] Move alloca(0) to wait_for_inferior() from registers_changed() Nick Duffek
2000-11-13  9:32                     ` Nick Duffek
2000-11-13  7:13                 ` [RFA] alloca coding standard Fernando Nasser
2000-11-13 12:31                 ` Nick Duffek
     [not found]                   ` <nsd@redhat.com>
2000-11-13 12:58                     ` Kevin Buettner
2000-11-13 13:19                       ` Nick Duffek
2000-11-14  7:42                         ` Jim Blandy
2000-11-14  7:54                           ` Michael Meissner
2000-11-14 10:27                             ` Jim Blandy
2000-11-14 17:15                               ` Andrew Cagney
2000-11-15  3:21                         ` Eli Zaretskii
2000-11-15 12:41                           ` Christopher Faylor
2000-11-15  3:20                   ` Eli Zaretskii
2000-11-10  2:40     ` alloca is bad? Eli Zaretskii
2000-11-11 11:52     ` Fernando Nasser
2000-11-11 16:13       ` Christopher Faylor
2000-11-12  0:20         ` Fernando Nasser
2000-11-11 21:39       ` Eli Zaretskii
2000-11-12  0:07         ` Fernando Nasser
2000-11-12  4:17           ` Eli Zaretskii
2000-11-12 10:39             ` Chris Faylor
2000-11-12 15:16               ` Andrew Cagney
2000-11-12 15:16             ` Fernando Nasser
2000-11-13  3:13               ` Eli Zaretskii
2000-11-13  8:05                 ` Michael Meissner
2000-11-12 16:49             ` Michael Meissner
2000-11-12  1:55         ` Andrew Cagney
2000-11-12 17:00           ` Michael Meissner
2000-11-13  3:14             ` Eli Zaretskii
2000-11-13  8:10               ` Michael Meissner
2000-11-13 12:14             ` Nick Duffek
2000-11-13 12:21               ` Michael Meissner
2000-11-13 13:24                 ` Nick Duffek
2000-11-14  6:37                   ` Michael Meissner
2000-11-14  7:39               ` Jim Blandy
2000-11-09 22:27 ` Andrew Cagney
2000-11-10  2:39 ` Eli Zaretskii
2000-11-10  8:16   ` Chris Faylor
2000-11-10  8:42     ` Fernando Nasser
2000-11-10  8:46       ` Christopher Faylor
2000-11-10  9:08         ` Fernando Nasser
2000-11-10 22:17           ` Andrew Cagney
2000-11-10  9:05       ` Michael Meissner [this message]
2000-11-10 12:00     ` Eli Zaretskii
2000-11-10 21:34     ` Andrew Cagney
2000-11-11 10:07       ` Christopher G. Faylor
2000-11-13  7:52         ` Jim Blandy
2000-11-13  8:25           ` Christopher G. Faylor
  -- strict thread matches above, loose matches on Subject: below --
2000-10-31 19:17 Subscribe gdb-prs@sources.redhat.com to gdb@sources.redhat.com? Christopher Faylor
2000-10-31 21:28 ` Andrew Cagney
2000-10-31 21:34   ` Christopher Faylor
2000-11-01  9:15     ` Tom Tromey
2000-11-01 10:54       ` Christopher Faylor
2000-10-26 20:10 GDB GNATS bug tracking database available Christopher Faylor
2000-10-28  4:41 ` Andrew Cagney
     [not found] ` <cgf@redhat.com>
2000-10-26 21:18   ` Kevin Buettner
2000-10-27  7:39     ` Fernando Nasser
2000-10-27  9:35     ` Christopher Faylor
2000-10-31 22:07   ` Subscribe gdb-prs@sources.redhat.com to gdb@sources.redhat.com? Kevin Buettner
2000-11-12 11:30   ` alloca is bad? Kevin Buettner
2000-11-12 15:32     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001110120544.43205@cse.cygnus.com \
    --to=meissner@cygnus.com \
    --cc=eliz@is.elta.co.il \
    --cc=fnasser@cygnus.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).