Commit 06cd5b6a authored by Hai Shi's avatar Hai Shi Committed by Serhiy Storchaka

bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)

parent 74142078
...@@ -22,11 +22,10 @@ extern "C" { ...@@ -22,11 +22,10 @@ extern "C" {
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
typedef struct { typedef struct {
PyObject_VAR_HEAD PyObject_VAR_HEAD
Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
char *ob_bytes; /* Physical backing buffer */ char *ob_bytes; /* Physical backing buffer */
char *ob_start; /* Logical start inside ob_bytes */ char *ob_start; /* Logical start inside ob_bytes */
/* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ Py_ssize_t ob_exports; /* How many buffer exports */
int ob_exports; /* How many buffer exports */
} PyByteArrayObject; } PyByteArrayObject;
#endif #endif
......
:class:`bytearray`, :class:`~array.array` and :class:`~mmap.mmap` objects allow now to export more than 2**31 buffers at a time.
\ No newline at end of file
...@@ -43,7 +43,7 @@ typedef struct arrayobject { ...@@ -43,7 +43,7 @@ typedef struct arrayobject {
Py_ssize_t allocated; Py_ssize_t allocated;
const struct arraydescr *ob_descr; const struct arraydescr *ob_descr;
PyObject *weakreflist; /* List of weak references */ PyObject *weakreflist; /* List of weak references */
int ob_exports; /* Number of exported buffers */ Py_ssize_t ob_exports; /* Number of exported buffers */
} arrayobject; } arrayobject;
static PyTypeObject Arraytype; static PyTypeObject Arraytype;
......
...@@ -97,7 +97,7 @@ typedef struct { ...@@ -97,7 +97,7 @@ typedef struct {
#else #else
off_t offset; off_t offset;
#endif #endif
int exports; Py_ssize_t exports;
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
HANDLE map_handle; HANDLE map_handle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment