This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: buffer/memoryview slice assignment uses only memcpy
Type: Stage: resolved
Components: Versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 2.7, Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Ronny.Pfannschmidt, skrah
Priority: normal Keywords:

Created on 2012-07-09 21:21 by Ronny.Pfannschmidt, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg165127 - (view) Author: Ronny Pfannschmidt (Ronny.Pfannschmidt) Date: 2012-07-09 21:21
thats broken for assigning overlaping regions, the memcpy docs explicitly state that memmove should be used in overlap cases
msg165180 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-07-10 09:17
Could you please state the Python version and line numbers in
memoryobject.c?
msg165208 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-07-10 22:24
I see nothing wrong in memory_ass_sub(). In 2.7:

    if (destbuf + bytelen < srcbuf || srcbuf + bytelen < destbuf)
        /* No overlapping */
        memcpy(destbuf, srcbuf, bytelen);
    else
        memmove(destbuf, srcbuf, bytelen);


Other versions use similar idioms.
History
Date User Action Args
2022-04-11 14:57:32adminsetgithub: 59514
2012-07-10 22:24:26skrahsetstatus: open -> closed
resolution: not a bug
messages: + msg165208

stage: resolved
2012-07-10 09:17:24skrahsetmessages: + msg165180
2012-07-10 00:10:54pitrousetnosy: + skrah
2012-07-09 21:21:53Ronny.Pfannschmidtcreate