MemArena: Add Darwin implementation

This commit is contained in:
OatmealDome
2025-01-08 12:46:31 -05:00
parent 9b3b6bea9d
commit d5dbb0b285
3 changed files with 241 additions and 0 deletions

View File

@ -7,6 +7,10 @@
#include <string_view>
#include <vector>
#ifdef __APPLE__
#include <mach/mach.h>
#endif
#include "Common/CommonTypes.h"
#include "Common/DynamicLibrary.h"
@ -120,6 +124,13 @@ private:
void* m_reserved_region = nullptr;
void* m_memory_handle = nullptr;
WindowsMemoryFunctions m_memory_functions;
#elif defined(__APPLE__)
vm_address_t m_shm_address = 0;
vm_size_t m_shm_size = 0;
mem_entry_name_port_t m_shm_entry = MACH_PORT_NULL;
vm_address_t m_region_address = 0;
vm_size_t m_region_size = 0;
#else
int m_shm_fd = 0;
void* m_reserved_region = nullptr;