< prev index next >

hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp

Print this page




 290 #ifdef _LP64
 291   return true;
 292 #else
 293   if (bytes < 2 * G) {
 294     return true;
 295   }
 296 
 297   char* addr = reserve_memory(bytes, NULL);
 298 
 299   if (addr != NULL) {
 300     release_memory(addr, bytes);
 301   }
 302 
 303   return addr != NULL;
 304 #endif // _LP64
 305 }
 306 
 307 ///////////////////////////////////////////////////////////////////////////////
 308 // thread stack
 309 
 310 size_t os::Linux::min_stack_allowed = 64 * K;


 311 
 312 size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
 313 #ifdef _LP64
 314   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 315 #else
 316   size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
 317 #endif // _LP64
 318   return s;
 319 }
 320 
 321 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 322   // Only enable glibc guard pages for non-Java threads
 323   // (Java threads have HotSpot guard pages)
 324   return (thr_type == java_thread ? 0 : page_size());
 325 }
 326 
 327 static void current_stack_region(address *bottom, size_t *size) {
 328   pthread_attr_t attr;
 329   int res = pthread_getattr_np(pthread_self(), &attr);
 330   if (res != 0) {
 331     if (res == ENOMEM) {
 332       vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");




 290 #ifdef _LP64
 291   return true;
 292 #else
 293   if (bytes < 2 * G) {
 294     return true;
 295   }
 296 
 297   char* addr = reserve_memory(bytes, NULL);
 298 
 299   if (addr != NULL) {
 300     release_memory(addr, bytes);
 301   }
 302 
 303   return addr != NULL;
 304 #endif // _LP64
 305 }
 306 
 307 ///////////////////////////////////////////////////////////////////////////////
 308 // thread stack
 309 
 310 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
 311 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
 312 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
 313 
 314 size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
 315 #ifdef _LP64
 316   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 317 #else
 318   size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K);
 319 #endif // _LP64
 320   return s;
 321 }
 322 
 323 size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
 324   // Only enable glibc guard pages for non-Java threads
 325   // (Java threads have HotSpot guard pages)
 326   return (thr_type == java_thread ? 0 : page_size());
 327 }
 328 
 329 static void current_stack_region(address *bottom, size_t *size) {
 330   pthread_attr_t attr;
 331   int res = pthread_getattr_np(pthread_self(), &attr);
 332   if (res != 0) {
 333     if (res == ENOMEM) {
 334       vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");


< prev index next >