Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@elta.co.il>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: carlton@kealia.com,gdb-patches@sources.redhat.com
Subject: Re: Avoid obstack_free in cp-namespace.c
Date: Tue, 10 Feb 2004 05:44:00 -0000	[thread overview]
Message-ID: <usmhjze0w.fsf@elta.co.il> (raw)
In-Reply-To: <20040209211010.GA25073@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 9 Feb 2004 16:10:10 -0500)

> Date: Mon, 9 Feb 2004 16:10:10 -0500
> From: Daniel Jacobowitz <drow@mvista.com>
> 
> -  char *name_copy = obsavestring (name, len, &objfile->objfile_obstack);
> -  struct symbol *sym = lookup_block_symbol (block, name_copy, NULL,
> -					    VAR_DOMAIN);
> +  char *name_copy = alloca (len + 1);
> +  struct symbol *sym;
> +
> +  memcpy (name_copy, name, len);
> +  name_copy[len] = '\0';

How large can the value of `len' be?  I believe we have some coding
guidelines against using alloca for allocations that are too large.


      parent reply	other threads:[~2004-02-10  5:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 21:10 Daniel Jacobowitz
2004-02-09 21:20 ` David Carlton
2004-02-09 22:25   ` Daniel Jacobowitz
2004-02-09 22:42 ` Elena Zannoni
2004-02-10  5:44   ` Eli Zaretskii
2004-02-10 17:28     ` Elena Zannoni
2004-02-10 18:55       ` Eli Zaretskii
2004-02-10  5:44 ` Eli Zaretskii [this message]

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=usmhjze0w.fsf@elta.co.il \
    --to=eliz@elta.co.il \
    --cc=carlton@kealia.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@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