diff options
author | Travis Oliphant <oliphant@enthought.com> | 2008-03-22 00:24:21 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2008-03-22 00:24:21 +0000 |
commit | be077dafb8ed2b9dc30f925868612cf7d7f56a2b (patch) | |
tree | 873a8f04caf03bb57788e95e55370d66c2e4b64c /numpy/core/src/arrayobject.c | |
parent | 9b9fcfc21898b8b27d28cde951da580ed706c082 (diff) | |
download | numpy-be077dafb8ed2b9dc30f925868612cf7d7f56a2b.tar.gz |
More complete fix to #647 so that fast copy is not attempted on portions of record arrays.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 567aa7750..3e11d3c3a 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -758,12 +758,7 @@ _copy_from0d(PyArrayObject *dest, PyArrayObject *src, int usecopy, int swap) sptr = aligned; } else sptr = src->data; - /* FIXME: This should check for a flag on the data-type - that states whether or not it is variable length. - Because the ISFLEXIBLE check is hard-coded to the - built-in data-types. - */ - if (PyArray_ISALIGNED(dest) && !PyArray_ISFLEXIBLE(dest)) { + if (PyArray_SAFEALIGNEDCOPY(dest)) { myfunc = _strided_byte_copy; } else if (usecopy) { @@ -865,7 +860,7 @@ int _flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) { it = (PyArrayIterObject *)PyArray_IterAllButAxis(src, &axis); if (it == NULL) return -1; - if (PyArray_ISALIGNED(src)) { + if (PyArray_SAFEALIGNEDCOPY(src)) { myfunc = _strided_byte_copy; } else { @@ -1061,7 +1056,7 @@ _array_copy_into(PyArrayObject *dest, PyArrayObject *src, int usecopy) return _copy_from0d(dest, src, usecopy, swap); } - if (PyArray_ISALIGNED(dest) && PyArray_ISALIGNED(src)) { + if (PyArray_SAFEALIGNEDCOPY(dest) && PyArray_SAFEALIGNEDCOPY(src)) { myfunc = _strided_byte_copy; } else if (usecopy) { @@ -1127,7 +1122,7 @@ PyArray_CopyAnyInto(PyArrayObject *dest, PyArrayObject *src) if (PyArray_SAMESHAPE(dest, src)) { int swap; - if (PyArray_ISALIGNED(dest) && PyArray_ISALIGNED(src)) { + if (PyArray_SAFEALIGNEDCOPY(dest) && PyArray_SAFEALIGNEDCOPY(src)) { myfunc = _strided_byte_copy; } else { |