mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
This commit is contained in:
parent
a4d9b17b1f
commit
f051e43b22
14 changed files with 83 additions and 97 deletions
|
@ -836,10 +836,10 @@ array_repeat(arrayobject *a, Py_ssize_t n)
|
|||
memset(np->ob_item, a->ob_item[0], newbytes);
|
||||
} else {
|
||||
Py_ssize_t done = oldbytes;
|
||||
Py_MEMCPY(np->ob_item, a->ob_item, oldbytes);
|
||||
memcpy(np->ob_item, a->ob_item, oldbytes);
|
||||
while (done < newbytes) {
|
||||
Py_ssize_t ncopy = (done <= newbytes-done) ? done : newbytes-done;
|
||||
Py_MEMCPY(np->ob_item+done, np->ob_item, ncopy);
|
||||
memcpy(np->ob_item+done, np->ob_item, ncopy);
|
||||
done += ncopy;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue