[PATCH] D48051: LTO: Work around a Windows kernel bug by keeping file handles open for memory mapped files.

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 15:11:05 PDT 2018


zturner added a comment.

In https://reviews.llvm.org/D48051#1129014, @pcc wrote:

> In https://reviews.llvm.org/D48051#1128998, @zturner wrote:
>
> > Is there any we can just transfer ownership of the original handle (with `FILE_FLAG_DELETE_ON_CLOSE`) from whoever had it before to the `TempFile`.  This way we can just not close that handle until we're sure we're done with it.
>
>
> I'm not sure what you mean. The `FILE_FLAG_DELETE_ON_CLOSE` handle is created and owned by `TempFile`. Do you mean transferring ownership from `TempFile` to `MemoryBuffer` when we map the file?


Yea, sorry.  I'm just worried that by copying and duplicating the handle, and cancelling the delete on close, and all this other stuff we're just exposing ourselves to even more strange problems.  It seems like the "correct" thing to do is to just keep the original handle open until we're absolutely done with that file.


https://reviews.llvm.org/D48051





More information about the llvm-commits mailing list