< prev index next >

src/os/posix/vm/os_posix.cpp

Print this page

        

*** 156,166 **** if (extra_base == NULL) { return NULL; } // Do manual alignment ! char* aligned_base = align_ptr_up(extra_base, alignment); // [ | | ] // ^ extra_base // ^ extra_base + begin_offset == aligned_base // extra_base + begin_offset + size ^ --- 156,166 ---- if (extra_base == NULL) { return NULL; } // Do manual alignment ! char* aligned_base = align_up(extra_base, alignment); // [ | | ] // ^ extra_base // ^ extra_base + begin_offset == aligned_base // extra_base + begin_offset + size ^
*** 320,330 **** } else { // perform the binary search. julong lower_limit = min_allocation_size; while ((upper_limit - lower_limit) > min_allocation_size) { julong temp_limit = ((upper_limit - lower_limit) / 2) + lower_limit; ! temp_limit = align_size_down_(temp_limit, min_allocation_size); if (is_allocatable(temp_limit)) { lower_limit = temp_limit; } else { upper_limit = temp_limit; } --- 320,330 ---- } else { // perform the binary search. julong lower_limit = min_allocation_size; while ((upper_limit - lower_limit) > min_allocation_size) { julong temp_limit = ((upper_limit - lower_limit) / 2) + lower_limit; ! temp_limit = align_down_(temp_limit, min_allocation_size); if (is_allocatable(temp_limit)) { lower_limit = temp_limit; } else { upper_limit = temp_limit; }
*** 1178,1188 **** _java_thread_min_stack_allowed = _java_thread_min_stack_allowed + JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size(); ! _java_thread_min_stack_allowed = align_size_up(_java_thread_min_stack_allowed, vm_page_size()); _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed, os_min_stack_allowed); size_t stack_size_in_bytes = ThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _java_thread_min_stack_allowed) { --- 1178,1188 ---- _java_thread_min_stack_allowed = _java_thread_min_stack_allowed + JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size(); ! _java_thread_min_stack_allowed = align_up(_java_thread_min_stack_allowed, vm_page_size()); _java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed, os_min_stack_allowed); size_t stack_size_in_bytes = ThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _java_thread_min_stack_allowed) {
*** 1202,1212 **** // Reminder: a compiler thread is a Java thread. _compiler_thread_min_stack_allowed = _compiler_thread_min_stack_allowed + JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size(); ! _compiler_thread_min_stack_allowed = align_size_up(_compiler_thread_min_stack_allowed, vm_page_size()); _compiler_thread_min_stack_allowed = MAX2(_compiler_thread_min_stack_allowed, os_min_stack_allowed); stack_size_in_bytes = CompilerThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _compiler_thread_min_stack_allowed) { --- 1202,1212 ---- // Reminder: a compiler thread is a Java thread. _compiler_thread_min_stack_allowed = _compiler_thread_min_stack_allowed + JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size(); ! _compiler_thread_min_stack_allowed = align_up(_compiler_thread_min_stack_allowed, vm_page_size()); _compiler_thread_min_stack_allowed = MAX2(_compiler_thread_min_stack_allowed, os_min_stack_allowed); stack_size_in_bytes = CompilerThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _compiler_thread_min_stack_allowed) {
*** 1214,1224 **** "Specify at least " SIZE_FORMAT "k", _compiler_thread_min_stack_allowed / K); return JNI_ERR; } ! _vm_internal_thread_min_stack_allowed = align_size_up(_vm_internal_thread_min_stack_allowed, vm_page_size()); _vm_internal_thread_min_stack_allowed = MAX2(_vm_internal_thread_min_stack_allowed, os_min_stack_allowed); stack_size_in_bytes = VMThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _vm_internal_thread_min_stack_allowed) { --- 1214,1224 ---- "Specify at least " SIZE_FORMAT "k", _compiler_thread_min_stack_allowed / K); return JNI_ERR; } ! _vm_internal_thread_min_stack_allowed = align_up(_vm_internal_thread_min_stack_allowed, vm_page_size()); _vm_internal_thread_min_stack_allowed = MAX2(_vm_internal_thread_min_stack_allowed, os_min_stack_allowed); stack_size_in_bytes = VMThreadStackSize * K; if (stack_size_in_bytes != 0 && stack_size_in_bytes < _vm_internal_thread_min_stack_allowed) {
*** 1274,1286 **** } // pthread_attr_setstacksize() may require that the size be rounded up to the OS page size. // Be careful not to round up to 0. Align down in that case. if (stack_size <= SIZE_MAX - vm_page_size()) { ! stack_size = align_size_up(stack_size, vm_page_size()); } else { ! stack_size = align_size_down(stack_size, vm_page_size()); } return stack_size; } --- 1274,1286 ---- } // pthread_attr_setstacksize() may require that the size be rounded up to the OS page size. // Be careful not to round up to 0. Align down in that case. if (stack_size <= SIZE_MAX - vm_page_size()) { ! stack_size = align_up(stack_size, vm_page_size()); } else { ! stack_size = align_down(stack_size, vm_page_size()); } return stack_size; }
< prev index next >