From e12c3da8bab83fd2b7cc96f1e2158828e48b8440 Mon Sep 17 00:00:00 2001 From: hai shi Date: Sun, 13 Oct 2019 22:58:09 +0800 Subject: [PATCH 1/3] Convert the type of ob_exports in PyByteArrayObject to Py_ssize_t. --- Include/bytearrayobject.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Include/bytearrayobject.h b/Include/bytearrayobject.h index a757b880592979..647a17a819d23f 100644 --- a/Include/bytearrayobject.h +++ b/Include/bytearrayobject.h @@ -22,11 +22,10 @@ extern "C" { #ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD - Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ - char *ob_bytes; /* Physical backing buffer */ - char *ob_start; /* Logical start inside ob_bytes */ - /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ - int ob_exports; /* How many buffer exports */ + Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ + char *ob_bytes; /* Physical backing buffer */ + char *ob_start; /* Logical start inside ob_bytes */ + Py_ssize_t ob_exports; /* How many buffer exports */ } PyByteArrayObject; #endif From 0e4d10834f9e9ff9bfa6fd07cb5a931326a7a716 Mon Sep 17 00:00:00 2001 From: hai shi Date: Sat, 19 Oct 2019 01:18:31 +0800 Subject: [PATCH 2/3] Convert the type of exports in arraymodule and mmapmodule to Py_ssize_t --- Modules/arraymodule.c | 2 +- Modules/mmapmodule.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 6aa981daca1d31..5ba261819db2ce 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -43,7 +43,7 @@ typedef struct arrayobject { Py_ssize_t allocated; const struct arraydescr *ob_descr; PyObject *weakreflist; /* List of weak references */ - int ob_exports; /* Number of exported buffers */ + Py_ssize_t ob_exports; /* Number of exported buffers */ } arrayobject; static PyTypeObject Arraytype; diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 0c641636a1a830..3b1c1d02978e6d 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -97,7 +97,7 @@ typedef struct { #else off_t offset; #endif - int exports; + Py_ssize_t exports; #ifdef MS_WINDOWS HANDLE map_handle; From f4665f58f594088a869e3d348110d6da7a3ad2aa Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2019 12:44:15 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst b/Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst new file mode 100644 index 00000000000000..4f77ebbfd02b83 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst @@ -0,0 +1 @@ +: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