Skip to content

Commit 1ff90f7

Browse files
authored
Merge pull request #881 from Unity-Technologies/il2cpp-implement-memory-mapped-file-icalls
Sync with IL2CPP changes for memory mapped files
2 parents d6f6688 + e73093f commit 1ff90f7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

mono/metadata/file-mmap-unity.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,15 @@ int mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void *
7777
MmapInstance *h = g_malloc0 (sizeof (MmapInstance));
7878
h->length = *size;
7979

80-
#ifdef HOST_WIN32
8180
h->address = UnityPalMemoryMappedFileMapWithParams((UnityPalFileHandle*) handle, (size_t) *size, (size_t) offset);
82-
#else
83-
MmapHandle *fh = (MmapHandle *)handle;
84-
h->address = UnityPalMemoryMappedFileMapWithFileDescriptor(fh->fd, (size_t) *size, (size_t) offset);
85-
#endif
8681

87-
if (h->address)
82+
if (h->address)
8883
{
8984
*mmap_handle = h;
9085
*base_address = (char*) h->address + offset;
9186
return 0;
92-
}
93-
else
87+
}
88+
else
9489
{
9590
g_free (h);
9691
return COULD_NOT_MAP_MEMORY;

0 commit comments

Comments
 (0)