92 friend class MallocTracker;
93 public:
94 enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel)
95
96 private:
97 static OSThread* _starting_thread;
98 static address _polling_page;
99 static volatile int32_t * _mem_serialize_page;
100 static uintptr_t _serialize_page_mask;
101 public:
102 static size_t _page_sizes[page_sizes_max];
103
104 private:
105 static void init_page_sizes(size_t default_page_size) {
106 _page_sizes[0] = default_page_size;
107 _page_sizes[1] = 0; // sentinel
108 }
109
110 static char* pd_reserve_memory(size_t bytes, char* addr = 0,
111 size_t alignment_hint = 0);
112 #if defined(AIX)
113 static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr, bool use_SHM = true);
114 #else
115 static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr);
116 #endif
117 static void pd_split_reserved_memory(char *base, size_t size,
118 size_t split, bool realloc);
119 static bool pd_commit_memory(char* addr, size_t bytes, bool executable);
120 static bool pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
121 bool executable);
122 // Same as pd_commit_memory() that either succeeds or calls
123 // vm_exit_out_of_memory() with the specified mesg.
124 static void pd_commit_memory_or_exit(char* addr, size_t bytes,
125 bool executable, const char* mesg);
126 static void pd_commit_memory_or_exit(char* addr, size_t size,
127 size_t alignment_hint,
128 bool executable, const char* mesg);
129 static bool pd_uncommit_memory(char* addr, size_t bytes);
130 static bool pd_release_memory(char* addr, size_t bytes);
131
132 static char* pd_map_memory(int fd, const char* file_name, size_t file_offset,
133 char *addr, size_t bytes, bool read_only = false,
134 bool allow_exec = false);
135 static char* pd_remap_memory(int fd, const char* file_name, size_t file_offset,
136 char *addr, size_t bytes, bool read_only,
|
92 friend class MallocTracker;
93 public:
94 enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel)
95
96 private:
97 static OSThread* _starting_thread;
98 static address _polling_page;
99 static volatile int32_t * _mem_serialize_page;
100 static uintptr_t _serialize_page_mask;
101 public:
102 static size_t _page_sizes[page_sizes_max];
103
104 private:
105 static void init_page_sizes(size_t default_page_size) {
106 _page_sizes[0] = default_page_size;
107 _page_sizes[1] = 0; // sentinel
108 }
109
110 static char* pd_reserve_memory(size_t bytes, char* addr = 0,
111 size_t alignment_hint = 0);
112 static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr);
113 static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr, int file_desc);
114 static void pd_split_reserved_memory(char *base, size_t size,
115 size_t split, bool realloc);
116 static bool pd_commit_memory(char* addr, size_t bytes, bool executable);
117 static bool pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
118 bool executable);
119 // Same as pd_commit_memory() that either succeeds or calls
120 // vm_exit_out_of_memory() with the specified mesg.
121 static void pd_commit_memory_or_exit(char* addr, size_t bytes,
122 bool executable, const char* mesg);
123 static void pd_commit_memory_or_exit(char* addr, size_t size,
124 size_t alignment_hint,
125 bool executable, const char* mesg);
126 static bool pd_uncommit_memory(char* addr, size_t bytes);
127 static bool pd_release_memory(char* addr, size_t bytes);
128
129 static char* pd_map_memory(int fd, const char* file_name, size_t file_offset,
130 char *addr, size_t bytes, bool read_only = false,
131 bool allow_exec = false);
132 static char* pd_remap_memory(int fd, const char* file_name, size_t file_offset,
133 char *addr, size_t bytes, bool read_only,
|