Skip to content

8234930: Use MAP_JIT when allocating pages for code cache on macOS #710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/hotspot/os/bsd/os_bsd.cpp
Original file line number Diff line number Diff line change
@@ -2183,15 +2183,18 @@ static int anon_munmap(char * addr, size_t size) {
return ::munmap(addr, size) == 0;
}

MACOS_ONLY(char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
#if defined(__APPLE__)
char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
size_t alignment_hint,
bool executable) {
return anon_mmap(requested_addr, bytes, (requested_addr != NULL), executable);
})
NOT_MACOS(char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
}
#else
char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
size_t alignment_hint) {
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
})
}
#endif

bool os::pd_release_memory(char* addr, size_t size) {
return anon_munmap(addr, size);