8000 bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16… · python/cpython@06cd5b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 06cd5b6

Browse files
shihai1991serhiy-storchaka
authored andcommitted
bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
1 parent 7414207 commit 06cd5b6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Include/bytearrayobject.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ extern "C" {
2222
#ifndef Py_LIMITED_API
2323
typedef struct {
2424
PyObject_VAR_HEAD
25-
Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
26-
char *ob_bytes; /* Physical backing buffer */
27-
char *ob_start; /* Logical start inside ob_bytes */
28-
/* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
29-
int ob_exports; /* How many buffer exports */
25+ Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
26+
char *ob_bytes; /* Physical backing buffer */
27+
char *ob_start; /* Logical start inside ob_bytes */
28+
Py_ssize_t ob_exports; /* How many buffer exports */
3029
} PyByteArrayObject;
3130
#endif
3231

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:class:`bytearray`, :class:`~array.array` and :class:`~mmap.mmap` objects allow now to export more than 2**31 buffers at a time.

Modules/arraymodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct arrayobject {
4343
Py_ssize_t allocated;
4444
const struct arraydescr *ob_descr;
4545
PyObject *weakreflist; /* List of weak references */
46-
int ob_exports; /* Number of exported buffers */
46+
Py_ssize_t ob_exports; /* Number of exported buffers */
4747
} arrayobject;
4848

4949
static PyTypeObject Arraytype;

Modules/mmapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ typedef struct {
9797
#else
9898
off_t offset;
9999
#endif
100-
int exports;
100+
Py_ssize_t exports;
101101

102102
#ifdef MS_WINDOWS
103103
HANDLE map_handle;

0 commit comments

Comments
 (0)
0