[llvm] r208021 - [Support/MemoryBuffer] Move the IsVolatile check inside shouldUseMmap() and make sure to zero-initialize the rest

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue May 6 16:11:25 PDT 2014

>> * If using mmap we will have to report fatal errors since we cannot
>> guarantee that the null terminator will be there if the file size
>> changes.
> How can we report fatal errors when using mmap ? mmap will map the page when the caller tries to read that memory part, at which point I don't see what we can do about it.

True. The lexer will just be surprised by a missing null :-( It would
be nice to handle that, but I assume that doing that has a substantial
cost, otherwise we wouldn't have all this setup just to get an ending
null byte.

In any case, looks like the correct thing to do is just delete the assert.


More information about the llvm-commits mailing list