Skip to content

Commit c3b2aa4

Browse files
Do not use copy-on-write on windows (#59194)
Co-authored-by: vsadov <[email protected]>
1 parent 0f2d026 commit c3b2aa4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/native/corehost/bundle/info.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ char* info_t::config_t::map(const pal::string_t& path, const location_t* &locati
108108
// * There is no performance limitation due to a larger sized mapping, since we actually only read the pages with relevant contents.
109109
// * Files that are too large to be mapped (ex: that exhaust 32-bit virtual address space) are not supported.
110110

111+
#ifdef _WIN32
112+
// Since we can't use in-situ parsing on Windows, as JSON data is encoded in
113+
// UTF-8 and the host expects wide strings.
114+
// We do not need COW and read-only mapping will be enough.
115+
char* addr = (char*)pal::mmap_read(app->m_bundle_path);
116+
#else // _WIN32
111117
char* addr = (char*)pal::mmap_copy_on_write(app->m_bundle_path);
118+
#endif // _WIN32
112119
if (addr == nullptr)
113120
{
114121
trace::error(_X("Failure processing application bundle."));

0 commit comments

Comments
 (0)