[PATCH] D90201: Try reading a smaller chunk when (p)read fails

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 11:26:56 PDT 2020


efriedma added a comment.

In D90201#2357105 <https://reviews.llvm.org/D90201#2357105>, @rnk wrote:

>> ... in which case llvm prefers not to mmap (as to not waste a whole page for the terminating NULL byte)
>
> We should really re-evaluate this behavior at some point. It is quite surprising.

I think the problem is that if the filesize is exactly a multiple of the page size, there isn't any simple way to allocate a null at the end of the file.  Certain uses (for example, clang's lexer) require null termination.  Most uses probably shouldn't be requesting null termination.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90201/new/

https://reviews.llvm.org/D90201



More information about the llvm-commits mailing list