◐ Shell
clean mode source ↗

gh-120754: Update estimated_size in C truncate by cmaloney · Pull Request #121357 · python/cpython

Sometimes a large file is truncated (test_largefile). While
estimated_size is used as a estimate (the read will stil get the number
of bytes in the file), that it is much larger than the actual size of
data can result in a significant over allocation and sometimes lead to
a MemoryError / running out of memory.

This brings the C implementation to match the Python _pyio
implementation.

@bedevere-app Bot mentioned this pull request

Jul 4, 2024

@cmaloney cmaloney changed the title gh-120754: Update size_estimated in C truncate gh-120754: Update estimated_size in C truncate

Jul 4, 2024

vstinner

@cmaloney cmaloney deleted the cmaloney/fix_largefile_amd64 branch

July 4, 2024 17:07

noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request

Jul 11, 2024
Sometimes a large file is truncated (test_largefile). While
estimated_size is used as a estimate (the read will stil get the number
of bytes in the file), that it is much larger than the actual size of
data can result in a significant over allocation and sometimes lead to
a MemoryError / running out of memory.

This brings the C implementation to match the Python _pyio
implementation.

estyxx pushed a commit to estyxx/cpython that referenced this pull request

Jul 17, 2024
Sometimes a large file is truncated (test_largefile). While
estimated_size is used as a estimate (the read will stil get the number
of bytes in the file), that it is much larger than the actual size of
data can result in a significant over allocation and sometimes lead to
a MemoryError / running out of memory.

This brings the C implementation to match the Python _pyio
implementation.