Skip to content

Commit cf73933

Browse files
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 <[email protected]>
1 parent c032a12 commit cf73933

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Include/internal/pycore_blocks_output_buffer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static const char unable_allocate_msg[] = "Unable to allocate output buffer.";
5757
/* Block size sequence */
5858
#define KB (1024)
5959
#define MB (1024*1024)
60-
const Py_ssize_t BUFFER_BLOCK_SIZE[] =
60+
static const Py_ssize_t BUFFER_BLOCK_SIZE[] =
6161
{ 32*KB, 64*KB, 256*KB, 1*MB, 4*MB, 8*MB, 16*MB, 16*MB,
6262
32*MB, 32*MB, 32*MB, 32*MB, 64*MB, 64*MB, 128*MB, 128*MB,
6363
OUTPUT_BUFFER_MAX_BLOCK_SIZE };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking collisions when bz2, lmza or zlib are statically linked.

0 commit comments

Comments
 (0)