diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-12-21 23:42:28 +1100 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-12-29 11:15:44 +1100 |
commit | 84aa7065deec49bab9fb0b085cd0a0dcc42cc479 (patch) | |
tree | 204b49257be7cb45e5146ff682c6437f7e9d2145 /gcc/function.cc | |
parent | ce81cd2eac686dc0f1c91ada0000c779add550b0 (diff) | |
download | gcc-84aa7065deec49bab9fb0b085cd0a0dcc42cc479.zip gcc-84aa7065deec49bab9fb0b085cd0a0dcc42cc479.tar.gz gcc-84aa7065deec49bab9fb0b085cd0a0dcc42cc479.tar.bz2 |
c++/modules: Fallback to ftruncate if posix_fallocate fails [PR115008]
Depending on the libc and filesystem, in cases where posix_fallocate
cannot do an efficient preallocation it may return EINVAL. In such a
case we should fall back to ftruncate instead.
Apparently, depending on the system the use of posix_fallocate can have
a noticeable speedup over ftruncate in general (depending on the system)
so it probably isn't worth it to use ftruncate in all cases.
PR c++/100358
PR c++/115008
gcc/cp/ChangeLog:
* module.cc (elf_out::create_mapping): Fallback to ftruncate if
posix_fallocate fails.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'gcc/function.cc')
0 files changed, 0 insertions, 0 deletions