Added iOS memoryMap, DirectoryReader, and process memory. (#480)

This commit is contained in:
Branimir Karadžić
2026-10-28 16:51:40 -07:00
committed by GitHub
parent 8e4aa941c8
commit d334432f25
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
#endif // BX_CONFIG_CRT_FILE_READER_WRITER
#ifndef BX_CONFIG_CRT_DIRECTORY_READER
# define BX_CONFIG_CRT_DIRECTORY_READER ( (BX_PLATFORM_OS_DESKTOP || BX_PLATFORM_ANDROID) && !BX_CRT_NONE)
# define BX_CONFIG_CRT_DIRECTORY_READER ( (BX_PLATFORM_OS_DESKTOP || BX_PLATFORM_ANDROID || BX_PLATFORM_IOS) && !BX_CRT_NONE)
#endif // BX_CONFIG_CRT_DIRECTORY_READER
#if BX_CRT_NONE
+6 -6
View File
@@ -41,7 +41,7 @@
# include <stdio.h> // fopen
# include <sys/mman.h>
# include <sys/syscall.h>
# elif BX_PLATFORM_OSX
# elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
# include <mach/mach.h> // mach_task_basic_info
# include <sys/mman.h>
# endif // BX_PLATFORM_ANDROID
@@ -172,7 +172,7 @@ namespace bx
? pages * sysconf(_SC_PAGESIZE)
: 0
;
#elif BX_PLATFORM_OSX
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
# if defined(MACH_TASK_BASIC_INFO)
mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
@@ -502,7 +502,7 @@ namespace bx
namespace
{
#if BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
#if BX_PLATFORM_ANDROID || BX_PLATFORM_IOS || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
static int32_t toPosixProt(uint32_t _protect)
{
switch (_protect)
@@ -555,7 +555,7 @@ namespace bx
BX_ASSERT(_alignment <= granularity, "Alignments greater than the allocation granularity are not implemented (requested %zu, granularity %zu).", _alignment, granularity);
BX_UNUSED(_alignment, granularity);
#if BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
#if BX_PLATFORM_ANDROID || BX_PLATFORM_IOS || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
if (NULL == _address)
{
if (0 == (state & Memory::Reserve) )
@@ -735,7 +735,7 @@ namespace bx
{
BX_ERROR_SCOPE(_err);
#if BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
#if BX_PLATFORM_ANDROID || BX_PLATFORM_IOS || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
int32_t result = munmap(_address, _size);
if (-1 == result)
@@ -766,7 +766,7 @@ namespace bx
{
const uint32_t page = _flags & Memory::PageMask;
#if BX_PLATFORM_ANDROID || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
#if BX_PLATFORM_ANDROID || BX_PLATFORM_IOS || BX_PLATFORM_LINUX || BX_PLATFORM_OSX
if (0 != (page & Memory::PageHuge) )
{
return 1ull << 30; // 1 GiB nominal