Parcourir la source

Correct RIOT os_mmap size type to size_t (#1002)

Change signature of riot `os_mmap` implementation to match declaration in core/shared/platform/include/platform_api_vmcore.h
Karl Fessel il y a 4 ans
Parent
commit
a22a5da40d
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      core/shared/platform/riot/riot_platform.c

+ 4 - 2
core/shared/platform/riot/riot_platform.c

@@ -44,9 +44,11 @@ os_free(void *ptr)
 }
 }
 
 
 void *
 void *
-os_mmap(void *hint, unsigned int size, int prot, int flags)
+os_mmap(void *hint, size_t size, int prot, int flags)
 {
 {
-    return BH_MALLOC(size);
+    if (size > ((unsigned)~0))
+        return NULL;
+    return BH_MALLOC((unsigned)size);
 }
 }
 
 
 void
 void