- 13 Feb, 2015 2 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
-
- 12 Feb, 2015 3 commits
-
-
Robert Bradshaw authored
-
Robert Bradshaw authored
-
Robert Bradshaw authored
-
- 10 Feb, 2015 1 commit
-
-
Robert Bradshaw authored
-
- 07 Feb, 2015 13 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
scoder authored
test: assert that isinf returns -1 for negative infinity
-
scoder authored
Fixes for buffer protocol docs
-
Lars Buitinck authored
[ci skip]
-
Lars Buitinck authored
-
Lars Buitinck authored
Makes sure (and documents, in a sense) that isinf's declaration as returning a bint preserves its C semantics.
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
- 06 Feb, 2015 1 commit
-
-
Stefan Behnel authored
-
- 05 Feb, 2015 3 commits
-
-
Robert Bradshaw authored
-
Robert Bradshaw authored
-
Robert Bradshaw authored
This will be useful for, e.g., implementing a fake cythonize that can leverage the deductions made by the real cythonize, but could have other uses as well.
-
- 04 Feb, 2015 4 commits
-
-
Robert Bradshaw authored
-
Robert Bradshaw authored
-
Robert Bradshaw authored
Their temporaries can't be references.
-
Robert Bradshaw authored
Docs: how to implement PEP 3118, the buffer protocol
-
- 01 Feb, 2015 9 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
scoder authored
work around memoryview.tobytes() off-by-one bug with suboffsets
-
Stefan Behnel authored
-
Stefan Behnel authored
-
- 29 Jan, 2015 2 commits
-
-
Richard Hansen authored
In CPython 2.7, the memoryview.tobytes() method (implemented in function memoryview_tobytes() in cpython/Objects/memoryobject.c) calls PyBuffer_ToContiguous() to copy the bytes in the buffer object to the newly allocated string memory. PyBuffer_ToContiguous() in turn calls PyBuffer_IsContiguous(), which always returns false when the suboffsets member of the Py_buffer struct is non-NULL (even if all entries in that array are negative!). When PyBuffer_IsContiguous() returns false, PyBuffer_ToContiguous() runs an alternative memory copy scheme which apparently has an off-by-one bug that the normal memory copy scheme doesn't have. This change sets the Py_buffer suboffsets member to NULL if all entries are negative, avoiding the off-by-one bug. To reproduce the bug: cpdef foo(): cdef unsigned char[:] v = bytearray("testing") # the following prints 'estingt' without this workaround print repr(memoryview(v).tobytes()) Signed-off-by: Richard Hansen <rhansen@bbn.com>
-
Richard Hansen authored
In CPython 2.7, the memoryview.tobytes() method (implemented in function memoryview_tobytes() in cpython/Objects/memoryobject.c) calls PyBuffer_ToContiguous() to copy the bytes in the buffer object to the newly allocated string memory. PyBuffer_ToContiguous() in turn calls PyBuffer_IsContiguous(), which always returns false when the suboffsets member of the Py_buffer struct is non-NULL (even if all entries in that array are negative!). When PyBuffer_IsContiguous() returns false, PyBuffer_ToContiguous() runs an alternative memory copy scheme which apparently has an off-by-one bug that the normal memory copy scheme doesn't have. This change sets the Py_buffer suboffsets member to NULL if all entries are negative, avoiding the off-by-one bug. To reproduce the bug: cpdef foo(): cdef unsigned char[:] v = bytearray("testing") # the following prints 'estingt' without this workaround print repr(memoryview(v).tobytes()) Signed-off-by: Richard Hansen <rhansen@bbn.com> --HG-- extra : transplant_source : h%F68%C5f%D2%A9%86%A7o%B4w%27%E5%EDt%3D%D5%3B%3C
-
- 01 Feb, 2015 2 commits
-
-
Stefan Behnel authored
-
Stefan Behnel authored
-