9 #include <mach/mach_init.h> 10 #include <mach-o/dyld.h> 11 #include <mach-o/getsect.h> 15 #include <AvailabilityMacros.h> 18 #include <libkern/OSAtomic.h> 19 #include <mach/mach.h> 20 #include <mach/semaphore.h> 21 #include <mach/task.h> 22 #include <mach/vm_statistics.h> 24 #include <semaphore.h> 29 #include <sys/resource.h> 30 #include <sys/sysctl.h> 32 #include <sys/types.h> 38 #include "src/base/macros.h" 39 #include "src/base/platform/platform-posix-time.h" 40 #include "src/base/platform/platform-posix.h" 41 #include "src/base/platform/platform.h" 46 std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
47 std::vector<SharedLibraryAddress> result;
48 unsigned int images_count = _dyld_image_count();
49 for (
unsigned int i = 0;
i < images_count; ++
i) {
50 const mach_header* header = _dyld_get_image_header(
i);
51 if (header ==
nullptr)
continue;
54 char* code_ptr = getsectdatafromheader_64(
55 reinterpret_cast<const mach_header_64*>(header), SEG_TEXT, SECT_TEXT,
59 char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size);
61 if (code_ptr ==
nullptr)
continue;
62 const intptr_t slide = _dyld_get_image_vmaddr_slide(
i);
64 result.push_back(SharedLibraryAddress(_dyld_get_image_name(
i), start,
65 start + size, slide));
70 void OS::SignalCodeMovingGC() {}
72 TimezoneCache* OS::CreateTimezoneCache() {
73 return new PosixDefaultTimezoneCache();