Skip to content

Sync with IL2CPP changes for memory mapped files #881

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions mono/metadata/file-mmap-unity.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,15 @@ int mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void *
MmapInstance *h = g_malloc0 (sizeof (MmapInstance));
h->length = *size;

#ifdef HOST_WIN32
h->address = UnityPalMemoryMappedFileMapWithParams((UnityPalFileHandle*) handle, (size_t) *size, (size_t) offset);
#else
MmapHandle *fh = (MmapHandle *)handle;
h->address = UnityPalMemoryMappedFileMapWithFileDescriptor(fh->fd, (size_t) *size, (size_t) offset);
#endif

if (h->address)
if (h->address)
{
*mmap_handle = h;
*base_address = (char*) h->address + offset;
return 0;
}
else
}
else
{
g_free (h);
return COULD_NOT_MAP_MEMORY;
Expand Down