Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Use XOBNEW when possible
Date: Thu, 26 Apr 2018 02:59:00 -0000	[thread overview]
Message-ID: <2bed0d1423307ef2d14696df13fea151@polymtl.ca> (raw)
In-Reply-To: <87wowu7whb.fsf@tromey.com>

On 2018-04-25 18:27, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
> 
> Simon> Since XOBNEW is now poisoned to prevent using it with
> Simon> non-trivially-constructible objects, it is worth using it over 
> plain
> Simon> obstack_alloc.  This patch changes the locations I could find 
> where we
> Simon> can do that change easily.
> 
> Thanks.
> 
> Simon> -  struct hppa_objfile_private *priv;
> Simon> +  hppa_objfile_private *priv
> Simon> +    = XOBNEW (&objfile->objfile_obstack, hppa_objfile_private);
> 
> Simon> -  priv = (struct hppa_objfile_private *)
> Simon> -  	 obstack_alloc (&objfile->objfile_obstack,
> Simon> -	 		sizeof (struct hppa_objfile_private));
> Simon>    set_objfile_data (objfile, hppa_objfile_priv_data, priv);
> Simon>    memset (priv, 0, sizeof (*priv));
> 
> Maybe ones that memset should be using OBSTACK_ZALLOC.

Right, I'll do that.

Thanks,

Simon


  reply	other threads:[~2018-04-26  2:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 19:40 [PATCH 1/2] Introduce obstack_new, poison other "typed" obstack functions Simon Marchi
2018-04-25 19:40 ` [PATCH 2/2] Use XOBNEW when possible Simon Marchi
2018-04-25 22:27   ` Tom Tromey
2018-04-26  2:59     ` Simon Marchi [this message]
2018-04-25 22:36 ` [PATCH 1/2] Introduce obstack_new, poison other "typed" obstack functions Tom Tromey
2018-04-26  2:58   ` Simon Marchi
2018-04-26 17:42     ` Tom Tromey

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=2bed0d1423307ef2d14696df13fea151@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=tom@tromey.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