[Python-checkins] bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) (GH-26844)

gpshead webhook-mailer at python.org
Tue Jun 22 03:10:32 EDT 2021


https://github.com/python/cpython/commit/cf739332bd039cd2303b58663a804f784883820d
commit: cf739332bd039cd2303b58663a804f784883820d
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: gpshead <greg at krypto.org>
date: 2021-06-22T00:10:23-07:00
summary:

bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) (GH-26844)

* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.
(cherry picked from commit 92c2e91580521ba5c85aa3205a0211df5b48689b)

Co-authored-by: Russell Keith-Magee <russell at keith-magee.com>

files:
A Misc/NEWS.d/next/Library/2021-06-20-07-14-46.bpo-44458.myqCQ0.rst
M Include/internal/pycore_blocks_output_buffer.h

diff --git a/Include/internal/pycore_blocks_output_buffer.h b/Include/internal/pycore_blocks_output_buffer.h
index 22546e9a32a80b..28cf6fba4eeba2 100644
--- a/Include/internal/pycore_blocks_output_buffer.h
+++ b/Include/internal/pycore_blocks_output_buffer.h
@@ -57,7 +57,7 @@ static const char unable_allocate_msg[] = "Unable to allocate output buffer.";
 /* Block size sequence */
 #define KB (1024)
 #define MB (1024*1024)
-const Py_ssize_t BUFFER_BLOCK_SIZE[] =
+static const Py_ssize_t BUFFER_BLOCK_SIZE[] =
     { 32*KB, 64*KB, 256*KB, 1*MB, 4*MB, 8*MB, 16*MB, 16*MB,
       32*MB, 32*MB, 32*MB, 32*MB, 64*MB, 64*MB, 128*MB, 128*MB,
       OUTPUT_BUFFER_MAX_BLOCK_SIZE };
diff --git a/Misc/NEWS.d/next/Library/2021-06-20-07-14-46.bpo-44458.myqCQ0.rst b/Misc/NEWS.d/next/Library/2021-06-20-07-14-46.bpo-44458.myqCQ0.rst
new file mode 100644
index 00000000000000..f15104b75e31c9
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-06-20-07-14-46.bpo-44458.myqCQ0.rst
@@ -0,0 +1 @@
+``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking collisions when bz2, lmza or zlib are statically linked.
\ No newline at end of file



More information about the Python-checkins mailing list