all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [Emacs-diffs] master 605f901: Prefer memcpy and memset to doing it by hand
Date: Fri, 05 Feb 2016 08:25:11 -0500	[thread overview]
Message-ID: <jwv1t8rtho0.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <E1aRUQf-0003kP-6V@vcs.savannah.gnu.org> (Paul Eggert's message of "Fri, 05 Feb 2016 00:39:17 +0000")

> +  if (XLI (init) == 0)
> +    memset (p->contents, 0, XFASTINT (length) * sizeof p->contents[0]);
> +  else
> +    for (ptrdiff_t i = 0; i < XFASTINT (length); i++)
> +      p->contents[i] = init;

FWIW, I much prefer keeping just the loop, over using this "if+memset"
which seems like an obvious case or too-early-optimization.


        Stefan



       reply	other threads:[~2016-02-05 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160205003917.14369.86929@vcs.savannah.gnu.org>
     [not found] ` <E1aRUQf-0003kP-6V@vcs.savannah.gnu.org>
2016-02-05 13:25   ` Stefan Monnier [this message]
2016-02-05 22:40     ` [Emacs-diffs] master 605f901: Prefer memcpy and memset to doing it by hand Paul Eggert
2016-02-07 17:53     ` John Wiegley
2016-02-07 21:24       ` Paul Eggert

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=jwv1t8rtho0.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.