Mercurial > cpython-lru_cache-weakref
diff Include/object.h @ 50490:26045ed0c26e 3.0
Merged revisions 68200 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r68200 | antoine.pitrou | 2009-01-03 17:59:18 +0100 (sam., 03 janv. 2009) | 8 lines
Issue #4580: slicing of memoryviews when itemsize != 1 is wrong.
Also fix len() to return number of items rather than length in bytes.
I'm sorry it was not possible for me to work on this without reindenting
a bit some stuff around. The indentation in memoryobject.c is a mess,
I'll open a separate bug for it.
........
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sat, 03 Jan 2009 17:10:05 +0000 |
| parents | d0619e210ac4 |
| children | af02b6e42142 c99ce0164699 |
line wrap: on
line diff
--- a/Include/object.h Sat Jan 03 17:06:28 2009 +0000 +++ b/Include/object.h Sat Jan 03 17:10:05 2009 +0000 @@ -144,16 +144,18 @@ typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ - Py_ssize_t len; - Py_ssize_t itemsize; /* This is Py_ssize_t so it can be - pointed to by strides in simple case.*/ - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + Py_ssize_t len; + Py_ssize_t itemsize; /* This is Py_ssize_t so it can be + pointed to by strides in simple case.*/ + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + Py_ssize_t smalltable[2]; /* static store for shape and strides of + mono-dimensional buffers. */ + void *internal; } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
