public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Wilco Dijkstra" <wdijkstr@arm.com>
To: "'Zack Weinberg'" <zackw@panix.com>, "Ondřej Bílka" <neleai@seznam.cz>
Cc: "GNU C Library" <libc-alpha@sourceware.org>
Subject: RE: [PATCH][AArch64] Optimized memcpy/memmove
Date: Mon, 05 Oct 2015 10:30:00 -0000	[thread overview]
Message-ID: <003901d0ff58$d34a4810$79ded830$@com> (raw)
In-Reply-To: <CAKCAbMg7unuoQyPUb0-X3-JZPf+D1YGqf0VtZcsD6x95NRVoPw@mail.gmail.com>

> Zack Weinberg wrote:
> Making memcpy the same as memmove is dangerous because then people
> will fail to notice when they *should* have used memmove.  If you do
> anything at all, detect an overlap and call abort().

Many memcpy implementations already behave like memmove for sizes smaller
than ~256 bytes, so combining them would not significantly increase the
danger. The behaviour of memcpy on overlaps is undefined, so it's reasonable
to do whatever happens to be fastest and do the additional checks in debug
libraries/sanitizers (oddly enough memcpy_chk does not check for overlaps).

Wilco


  reply	other threads:[~2015-10-05 10:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 13:16 Wilco Dijkstra
2015-09-27  8:44 ` Ondřej Bílka
2015-09-28  9:35   ` Wilco Dijkstra
2015-09-30 12:28     ` Ondřej Bílka
2015-09-30 14:37       ` Zack Weinberg
2015-10-05 10:30         ` Wilco Dijkstra [this message]
2015-12-15 16:40 Wilco Dijkstra
2016-04-15 12:43 ` Wilco Dijkstra
2016-05-12 14:01 ` Wilco Dijkstra
2016-05-12 15:40 ` Marcus Shawcroft
2016-05-12 16:25   ` Wilco Dijkstra
2016-05-19 11:33     ` Wilco Dijkstra
2016-06-10  7:06     ` Marcus Shawcroft

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='003901d0ff58$d34a4810$79ded830$@com' \
    --to=wdijkstr@arm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=neleai@seznam.cz \
    --cc=zackw@panix.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).