[PATCH] D28010: FileOutputBuffer: support non-mmap'able file.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 07:53:56 PST 2017


Rafael Avila de Espindola <rafael.espindola at gmail.com> writes:

> Rui Ueyama <ruiu at google.com> writes:
>
>>> That is why I suggested using fs::createTemporaryFile for non regular
>>> files. It will create a file in /tmp.
>>>
>>
>> I don't think using fs::createTemporaryFile is an improvement. Currently,
>> I'm using malloc'ed memory region as a buffer, so it is probably faster
>> than file-system-backed file and will leave nothing if a program crashes
>> unexpectedly. I don't see a benefit of using createTemporaryFile.
>
> It would be a far smaller code path for the non mmapable case.
>
> The problem of leaving files behind is independent and should be fixed
> for both cases by using an unlinked temporary.

I am giving that a try.

Cheers,
Rafael


More information about the llvm-commits mailing list