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

Serhiy Storchaka webhook-mailer at python.org
Mon Oct 21 02:31:51 EDT 2019


https://github.com/python/cpython/commit/06cd5b6acd98205adae1a3ea4223e88f38ad55ab
commit: 06cd5b6acd98205adae1a3ea4223e88f38ad55ab
branch: master
author: Hai Shi <shihai1992 at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019年10月21日T09:31:46+03:00
summary:
bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
files:
A Misc/NEWS.d/next/Core and Builtins/2019-10-19-12-44-13.bpo-38465.V1L8c4.rst
M Include/bytearrayobject.h
M Modules/arraymodule.c
M Modules/mmapmodule.c
diff --git a/Include/bytearrayobject.h b/Include/bytearrayobject.h
index a757b88059297..647a17a819d23 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
 
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 0000000000000..4f77ebbfd02b8
--- /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
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 6aa981daca1d3..5ba261819db2c 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 a3b9e4df95305..a5c0ae0eaf065 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;


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /