mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
parent
d297f1ad78
commit
75ee9eb9c6
2 changed files with 6 additions and 1 deletions
|
@ -48,6 +48,8 @@ Core and builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #3116 and #1792: Fix quadratic behavior in marshal.dumps().
|
||||||
|
|
||||||
- Issue #2682: ctypes callback functions no longer contain a cyclic
|
- Issue #2682: ctypes callback functions no longer contain a cyclic
|
||||||
reference to themselves.
|
reference to themselves.
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,10 @@ w_more(int c, WFILE *p)
|
||||||
if (p->str == NULL)
|
if (p->str == NULL)
|
||||||
return; /* An error already occurred */
|
return; /* An error already occurred */
|
||||||
size = PyString_Size(p->str);
|
size = PyString_Size(p->str);
|
||||||
newsize = size + 1024;
|
newsize = size + size + 1024;
|
||||||
|
if (newsize > 32*1024*1024) {
|
||||||
|
newsize = size + (size >> 3); /* 12.5% overallocation */
|
||||||
|
}
|
||||||
if (_PyString_Resize(&p->str, newsize) != 0) {
|
if (_PyString_Resize(&p->str, newsize) != 0) {
|
||||||
p->ptr = p->end = NULL;
|
p->ptr = p->end = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue