]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)
authorRussell Keith-Magee <russell@keith-magee.com>
Tue, 22 Jun 2021 06:36:36 +0000 (14:36 +0800)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 06:36:36 +0000 (23:36 -0700)
* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.

Include/internal/pycore_blocks_output_buffer.h
Misc/NEWS.d/next/Library/2021-06-20-07-14-46.bpo-44458.myqCQ0.rst [new file with mode: 0644]

index 22546e9a32a80b13c74a04a82e381b9a64fb13fa..28cf6fba4eeba2e68d7cde88b676589befae4c48 100644 (file)
@@ -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 (file)
index 0000000..f15104b
--- /dev/null
@@ -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