]> granicus.if.org Git - gc/commitdiff
Implement memory unmapping for Sony PS/3
authorJonathan Chambers <joncham@gmail.com>
Sun, 14 Jan 2018 07:23:34 +0000 (10:23 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 14 Jan 2018 07:28:13 +0000 (10:28 +0300)
(part of commit 9379c66 from Unity-Technologies/bdwgc)

Issue #173 (bdwgc).

* os_dep.c [USE_MUNMAP && !MSWIN32 && !MSWINCE && SN_TARGET_PS3]:
Include sys/mman.h instead of sys/memory.h.
* os_dep.c [USE_MUNMAP && !USE_WINALLOC && SN_TARGET_PS3]
(GC_unmap): Call ps3_free_mem() instead of mmap().

os_dep.c

index d4ff12c5d7601ff63f19e2ccecb34dd188eb0f97..5827706d870969f0db7f9247c82ef93810043b52 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2433,7 +2433,11 @@ void * os2_alloc(size_t bytes)
 
 #if !defined(MSWIN32) && !defined(MSWINCE)
 # include <unistd.h>
-# include <sys/mman.h>
+# ifdef SN_TARGET_PS3
+#   include <sys/memory.h>
+# else
+#   include <sys/mman.h>
+# endif
 # include <sys/stat.h>
 # include <sys/types.h>
 #endif
@@ -2490,6 +2494,8 @@ GC_INNER void GC_unmap(ptr_t start, size_t bytes)
           start_addr += free_len;
           len -= free_len;
       }
+#   elif defined(SN_TARGET_PS3)
+      ps3_free_mem(start_addr, len);
 #   else
       /* We immediately remap it to prevent an intervening mmap from    */
       /* accidentally grabbing the same address space.                  */