[llvm] [Support] mmap when possible in getSTDIN. (PR #162013)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 01:53:51 PDT 2025
jh7370 wrote:
> Currently, some programs rely *c = '\0' to find the end of a buffer instead of the provided size. In my experiment, therefore, it is impossible for us to mmap in all cases since some file may not have '\0' in the end of the file and requires copy buffer and append '\0' manually. However, it would be a huge performace improvement if we use mmap when processing a huge file. Can I rely on the test-suite's results to make sure which program rely on *c = '\0' and therefore provide mmap acceleration for other programs?
Without knowing the context, it sounds to me like a tool that ignores the provided size and looks for a trailing null terminator has a bug in it (what if the input contains null bytes other than at the end of the data?), so the tool should be updated. What tools rely on this behaviour?
https://github.com/llvm/llvm-project/pull/162013
More information about the llvm-commits
mailing list