[PATCH] D39464: Define fs::allocate_file which preallocates disk blocks.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 15:07:01 PST 2017


Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> +  if (auto EC = fs::allocate_file(FD, Size)) {
> +    fs::remove(TempPath);
> +    if (EC == errc::function_not_supported)
> +      return createInMemoryBuffer(Path, Size, Mode);

Gah, I knew I would forget it.

This change requires changing InMemoryBuffer::commit. If the output file
is regular it should first write to a temporary and then rename.

Cheers,
Rafael


More information about the llvm-commits mailing list