Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <shebs@apple.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] use memset to zero the fields of a new frame_info
Date: Thu, 17 May 2001 13:24:00 -0000	[thread overview]
Message-ID: <3B04330A.21E8784E@apple.com> (raw)
In-Reply-To: <3B042FD4.81EE2FC3@cygnus.com>

Michael Snyder wrote:
> 
> One call to memset does a better job than some number of individual assigns,
> esp. since it's guaranteed to get new fields that would be missed otherwise
> (and were being).
> 
> 2001-05-17  Michael Snyder  <msnyder@redhat.com>
> 
>         * blockframe.c (create_new_frame): Zero all the fields via memset,
>         rather than zeroing them one by one.

Ah, the end of an era.  Gilmore originally objected to this kind of
thing, on the theory that it was "machine-gunning" memory and wasn't
necessary - only set fields that you know need to be zeroed.  I'm on
the fence, because it can save bugs and random scattered init code
if you can assume that newly-allocated data all has known values, and
clearing small-to-medium-size structs isn't expensive usually.

In any case, the policy ought to be clarified one way or the other.

Stan


  reply	other threads:[~2001-05-17 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-17 13:08 Michael Snyder
2001-05-17 13:24 ` Stan Shebs [this message]
2001-05-17 21:04   ` Andrew Cagney
2001-05-20 13:06     ` Jim Blandy

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=3B04330A.21E8784E@apple.com \
    --to=shebs@apple.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.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