Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().

This commit is contained in:
Christian Heimes 2016-09-13 20:22:02 +02:00
parent a4d9b17b1f
commit f051e43b22
14 changed files with 83 additions and 97 deletions

View file

@ -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;
}
}