]> granicus.if.org Git - python/commitdiff
bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
authorHai Shi <shihai1992@gmail.com>
Mon, 21 Oct 2019 06:31:46 +0000 (14:31 +0800)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 21 Oct 2019 06:31:46 +0000 (09:31 +0300)
Include/bytearrayobject.h
Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst [new file with mode: 0644]
Modules/arraymodule.c
Modules/mmapmodule.c

index a757b880592979fe8f2496f32b95868273a71b1a..647a17a819d23f9bd46b103c8e81359f451aa73d 100644 (file)
@@ -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
 
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 (file)
index 0000000..4f77ebb
--- /dev/null
@@ -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
index 6aa981daca1d3105b6e240ccec1b4845a707b2e5..5ba261819db2cef374c92db5d5208c8d25cabba7 100644 (file)
@@ -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;
index a3b9e4df95305e05286400e3d79799aac52eb5e9..a5c0ae0eaf065a3f835e76d01e0e08f7e66a48ab 100644 (file)
@@ -97,7 +97,7 @@ typedef struct {
 #else
     off_t       offset;
 #endif
-    int     exports;
+    Py_ssize_t  exports;
 
 #ifdef MS_WINDOWS
     HANDLE      map_handle;