summaryrefslogtreecommitdiff
path: root/Include/object.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-04-02 21:18:34 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2009-04-02 21:18:34 +0000
commit789be0c0a0656d17f831aa781cf7c5d55e5b4835 (patch)
tree8ce796bd726fcbbb4c9f19ae2d3601517ebbee91 /Include/object.h
parent48e3fd240fc6338fbcbbc9c1c8a7d118faca924a (diff)
downloadcpython-git-789be0c0a0656d17f831aa781cf7c5d55e5b4835.tar.gz
Issue #2396: backport the memoryview object.
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/Include/object.h b/Include/object.h
index c40d36201d..cfca64f9ab 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -159,21 +159,23 @@ typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);
typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
-/* Py3k buffer interface */
+/* Py3k buffer interface */
typedef struct bufferinfo {
- void *buf;
- PyObject *obj; /* borrowed 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;
+ 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;
+ 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);