12#include <sys/resource.h>
13#include <sys/syscall.h>
38 return new PosixDefaultTimezoneCache();
42 std::vector<SharedLibraryAddress>
result;
46 FILE* fp = fopen(
"/proc/self/maps",
"r");
47 if (fp ==
nullptr)
return result;
50 const int kLibNameLen = FILENAME_MAX + 1;
51 char* lib_name =
reinterpret_cast<char*
>(malloc(kLibNameLen));
56 char attr_r, attr_w, attr_x, attr_p;
59 if (fscanf(fp,
" %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4)
break;
62 if (attr_r ==
'r' && attr_w !=
'w' && attr_x ==
'x') {
67 }
while ((c != EOF) && (c !=
'\n') && (c !=
'/'));
75 if (fgets(lib_name, kLibNameLen, fp) ==
nullptr)
break;
80 lib_name[strlen(lib_name) - 1] =
'\0';
83 snprintf(lib_name, kLibNameLen,
92 }
while ((c != EOF) && (c !=
'\n'));
110 long size = sysconf(_SC_PAGESIZE);
111 FILE* f = fopen(OS::GetGCFakeMMapFile(),
"w+");
113 OS::PrintError(
"Failed to open %s\n", OS::GetGCFakeMMapFile());
117 mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fileno(f), 0);
118 DCHECK(addr != MAP_FAILED);
static void SignalCodeMovingGC()
static std::vector< SharedLibraryAddress > GetSharedLibraryAddresses()
static TimezoneCache * CreateTimezoneCache()
static void Free(void *address, size_t size)
static std::optional< MemoryRange > GetFirstFreeMemoryRangeWithin(Address boundary_start, Address boundary_end, size_t minimum_size, size_t alignment)
static void AdjustSchedulingParams()
ZoneVector< RpoNumber > & result
#define DCHECK(condition)