equal
deleted
inserted
replaced
2135 size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); |
2135 size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); |
2136 |
2136 |
2137 int allocate = os::allocate_stack_guard_pages(); |
2137 int allocate = os::allocate_stack_guard_pages(); |
2138 // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len); |
2138 // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len); |
2139 |
2139 |
2140 if (allocate && !os::commit_memory((char *) low_addr, len)) { |
2140 if (allocate && !os::create_stack_guard_pages((char *) low_addr, len)) { |
2141 warning("Attempt to allocate stack guard pages failed."); |
2141 warning("Attempt to allocate stack guard pages failed."); |
2142 return; |
2142 return; |
2143 } |
2143 } |
2144 |
2144 |
2145 if (os::guard_memory((char *) low_addr, len)) { |
2145 if (os::guard_memory((char *) low_addr, len)) { |
2156 if (_stack_guard_state == stack_guard_unused) return; |
2156 if (_stack_guard_state == stack_guard_unused) return; |
2157 address low_addr = stack_base() - stack_size(); |
2157 address low_addr = stack_base() - stack_size(); |
2158 size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); |
2158 size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); |
2159 |
2159 |
2160 if (os::allocate_stack_guard_pages()) { |
2160 if (os::allocate_stack_guard_pages()) { |
2161 if (os::uncommit_memory((char *) low_addr, len)) { |
2161 if (os::remove_stack_guard_pages((char *) low_addr, len)) { |
2162 _stack_guard_state = stack_guard_unused; |
2162 _stack_guard_state = stack_guard_unused; |
2163 } else { |
2163 } else { |
2164 warning("Attempt to deallocate stack guard pages failed."); |
2164 warning("Attempt to deallocate stack guard pages failed."); |
2165 } |
2165 } |
2166 } else { |
2166 } else { |