-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Cleanup most usages of Windows file mapping #121896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| #ifdef HOST_WINDOWS | ||
| #define MEMORY_MAPPED_STRESSLOG_BASE_ADDRESS (void*)0x400000000000 | ||
| #else | ||
| #define MEMORY_MAPPED_STRESSLOG_BASE_ADDRESS nullptr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this removing support for memory mapped stresslog on non-Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. NativeAOT copy of stresslog removes memory map support on all platforms. I haven't measured the impact.
src/coreclr/minipal/dn-memmap.h
Outdated
| #ifdef TARGET_WINDOWS | ||
| HANDLE m_hFileMapping; | ||
| #endif | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifdef TARGET_WINDOWS | |
| HANDLE m_hFileMapping; | |
| #endif | |
This can be deleted from here (close the FileMapping handle at the end of the Open method instead)
|
|
||
| Fail: | ||
| if (hFile != INVALID_HANDLE_VALUE) | ||
| CloseHandle(hFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handle should be closed on the success path too.
The remaining cases are superpmi (included in #121367) and PEImage, which involves LoadLibrary and we would want more future-proof abstraction.
All the cases included in this PR are transitively used by ilasm/ildasm. For stgio, I'm doing simple ifdef's on OS api, since it's too complicated around different I/O models, and we would get rid of it with new metadata library.