sanitizer_common: bump default file max size to 256MB
I am hitting some cases where /proc/self/maps does not fit into 64MB. 256MB is lots of memory, but it's not radically more than the current 64MB. Ideally we should read/parse these huge files incrementally, but that's lots of work for a debugging/introspection interface. So for now just bump the limit. Depends on D112793. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D112794
This commit is contained in:
parent
e8861fa6c3
commit
af0a8b8317
|
|
@ -721,12 +721,15 @@ void SortAndDedup(Container &v, Compare comp = {}) {
|
||||||
v.resize(last + 1);
|
v.resize(last + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr uptr kDefaultFileMaxSize = FIRST_32_SECOND_64(1 << 26, 1 << 28);
|
||||||
|
|
||||||
// Opens the file 'file_name" and reads up to 'max_len' bytes.
|
// Opens the file 'file_name" and reads up to 'max_len' bytes.
|
||||||
// The resulting buffer is mmaped and stored in '*buff'.
|
// The resulting buffer is mmaped and stored in '*buff'.
|
||||||
// Returns true if file was successfully opened and read.
|
// Returns true if file was successfully opened and read.
|
||||||
bool ReadFileToVector(const char *file_name,
|
bool ReadFileToVector(const char *file_name,
|
||||||
InternalMmapVectorNoCtor<char> *buff,
|
InternalMmapVectorNoCtor<char> *buff,
|
||||||
uptr max_len = 1 << 26, error_t *errno_p = nullptr);
|
uptr max_len = kDefaultFileMaxSize,
|
||||||
|
error_t *errno_p = nullptr);
|
||||||
|
|
||||||
// Opens the file 'file_name" and reads up to 'max_len' bytes.
|
// Opens the file 'file_name" and reads up to 'max_len' bytes.
|
||||||
// This function is less I/O efficient than ReadFileToVector as it may reread
|
// This function is less I/O efficient than ReadFileToVector as it may reread
|
||||||
|
|
@ -737,7 +740,7 @@ bool ReadFileToVector(const char *file_name,
|
||||||
// The total number of read bytes is stored in '*read_len'.
|
// The total number of read bytes is stored in '*read_len'.
|
||||||
// Returns true if file was successfully opened and read.
|
// Returns true if file was successfully opened and read.
|
||||||
bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size,
|
bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size,
|
||||||
uptr *read_len, uptr max_len = 1 << 26,
|
uptr *read_len, uptr max_len = kDefaultFileMaxSize,
|
||||||
error_t *errno_p = nullptr);
|
error_t *errno_p = nullptr);
|
||||||
|
|
||||||
// When adding a new architecture, don't forget to also update
|
// When adding a new architecture, don't forget to also update
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue