Don't require a null terminator when loading objects
authorDavid Major <dmajor@mozilla.com>
Wed, 9 Jan 2019 23:36:32 +0000 (23:36 +0000)
committerDavid Major <dmajor@mozilla.com>
Wed, 9 Jan 2019 23:36:32 +0000 (23:36 +0000)
commit30ba0a0c950a0cdf23a70fce6c16d501c5f238c8
tree15bca9082414c8a958960309d18180999070afc7
parentf3a4770475c7d503ed66667f0085f0cdbfc3bbe9
Don't require a null terminator when loading objects

When a null terminator is required and the file size is a multiple of the system page size, MemoryBuffer will prefer pread() over mmap(), which can result in excessive memory usage.

Patch by Mike Hommey!

Differential Revision: https://reviews.llvm.org/D56475

llvm-svn: 350774
llvm/lib/Object/Binary.cpp