mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
make remove_stack_guard_pages return void
This commit is contained in:
parent
2c7116ea71
commit
21e0a63e52
@ -1733,10 +1733,9 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
void os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
// Do not call this; no need to commit stack pages on AIX.
|
||||
ShouldNotReachHere();
|
||||
return true;
|
||||
}
|
||||
|
||||
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||
|
||||
@ -1763,9 +1763,8 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||
|
||||
// If this is a growable mapping, remove the guard pages entirely by
|
||||
// munmap()ping them. If not, just call uncommit_memory().
|
||||
bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
void os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
os::uncommit_memory(addr, size, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 'requested_addr' is only treated as a hint, the return value may or
|
||||
|
||||
@ -3566,14 +3566,15 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||
// It's safe to always unmap guard pages for primordial thread because we
|
||||
// always place it right after end of the mapped region.
|
||||
|
||||
bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
uintptr_t stack_extent, stack_base;
|
||||
void os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
|
||||
if (os::is_primordial_thread()) {
|
||||
return ::munmap(addr, size) == 0;
|
||||
if (::munmap(addr, size) != 0) {
|
||||
fatal("Failed to munmap " RANGEFMT, RANGEFMTARGS(addr, size));
|
||||
}
|
||||
return;
|
||||
}
|
||||
os::uncommit_memory(addr, size, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 'requested_addr' is only treated as a hint, the return value may or
|
||||
|
||||
@ -3656,9 +3656,8 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||
return os::commit_memory(addr, size, !ExecMem);
|
||||
}
|
||||
|
||||
bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
void os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||
os::uncommit_memory(addr, size, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool protect_pages_individually(char* addr, size_t bytes, unsigned int p, DWORD *old_status) {
|
||||
|
||||
@ -515,7 +515,7 @@ class os: AllStatic {
|
||||
static bool unguard_memory(char* addr, size_t bytes);
|
||||
static bool create_stack_guard_pages(char* addr, size_t bytes);
|
||||
static bool pd_create_stack_guard_pages(char* addr, size_t bytes);
|
||||
static bool remove_stack_guard_pages(char* addr, size_t bytes);
|
||||
static void remove_stack_guard_pages(char* addr, size_t bytes);
|
||||
// Helper function to create a new file with template jvmheap.XXXXXX.
|
||||
// Returns a valid fd on success or else returns -1
|
||||
static int create_file_for_heap(const char* dir);
|
||||
|
||||
@ -116,13 +116,8 @@ void StackOverflow::remove_stack_guard_pages() {
|
||||
size_t len = stack_guard_zone_size();
|
||||
|
||||
if (os::must_commit_stack_guard_pages()) {
|
||||
if (os::remove_stack_guard_pages((char *) low_addr, len)) {
|
||||
os::remove_stack_guard_pages((char *) low_addr, len);
|
||||
_stack_guard_state = stack_guard_unused;
|
||||
} else {
|
||||
log_warning(os, thread)("Attempt to deallocate stack guard pages failed ("
|
||||
PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (_stack_guard_state == stack_guard_unused) return;
|
||||
if (os::unguard_memory((char *) low_addr, len)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user