Skip to content
Commit 429088b9 authored by Duncan P. N. Exon Smith's avatar Duncan P. N. Exon Smith
Browse files

Support: Extract fs::resize_file_before_mapping_readwrite from FileOutputBuffer

Add a variant of `fs::resize_file` for use immediately before opening a
file with `mapped_file_region::readwrite`. On Windows, `_chsize`
(`ftruncate`) is slow, but `CreateFileMapping` (`mmap`) automatically
extends the file so the call to `fs::resize_file` can be skipped.

This optimization was added to `FileOutputBuffer` in
da9bc2e5; this commit just extracts the
logic out and adds a unit test.

Differential Revision: https://reviews.llvm.org/D95490
parent 38b106f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment