mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-129813, PEP 782: Add PyBytesWriter.overallocate (#138941)
Disable overallocation in _PyBytes_FormatEx() at the last write.
This commit is contained in:
parent
4554486f15
commit
4e00e2504f
2 changed files with 21 additions and 9 deletions
|
|
@ -147,6 +147,15 @@ PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
|
|||
PyAPI_FUNC(PyBytesWriter*) _PyBytesWriter_CreateByteArray(
|
||||
Py_ssize_t size);
|
||||
|
||||
|
||||
struct PyBytesWriter {
|
||||
char small_buffer[256];
|
||||
PyObject *obj;
|
||||
Py_ssize_t size;
|
||||
int use_bytearray;
|
||||
int overallocate;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue