< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page

        

*** 824,836 **** (GetMinStack)dlsym(RTLD_DEFAULT, "__pthread_get_minstack"); log_info(os, thread)("Lookup of __pthread_get_minstack %s", _get_minstack_func == NULL ? "failed" : "succeeded"); } // Returns the size of the static TLS area glibc puts on thread stacks. static size_t get_static_tls_area_size(const pthread_attr_t *attr) { ! size_t tls_size = 0; if (_get_minstack_func != NULL) { // Obtain the pthread minstack size by calling __pthread_get_minstack. size_t minstack_size = _get_minstack_func(attr); // Remove non-TLS area size included in minstack size returned --- 824,840 ---- (GetMinStack)dlsym(RTLD_DEFAULT, "__pthread_get_minstack"); log_info(os, thread)("Lookup of __pthread_get_minstack %s", _get_minstack_func == NULL ? "failed" : "succeeded"); } + static bool tls_size_inited = false; + static size_t tls_size = 0; // Returns the size of the static TLS area glibc puts on thread stacks. static size_t get_static_tls_area_size(const pthread_attr_t *attr) { ! if (!tls_size_inited) { ! tls_size_inited = true; ! if (_get_minstack_func != NULL) { // Obtain the pthread minstack size by calling __pthread_get_minstack. size_t minstack_size = _get_minstack_func(attr); // Remove non-TLS area size included in minstack size returned
*** 857,866 **** --- 861,871 ---- // if check is done for precaution. if (minstack_size > (size_t)os::vm_page_size() + PTHREAD_STACK_MIN) { tls_size = minstack_size - os::vm_page_size() - PTHREAD_STACK_MIN; } } + } log_info(os, thread)("Stack size adjustment for TLS is " SIZE_FORMAT, tls_size); return tls_size; }
< prev index next >