unix: expose thread_stack_size() internally
This function will be used by `uv__fsevents_loop_init` in a future commit to determine the initial FSEvents pthread stack size. PR-URL: https://github.com/libuv/libuv/pull/3132 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
e24e5cbc2b
commit
054a495351
@ -261,6 +261,7 @@ void uv__prepare_close(uv_prepare_t* handle);
|
|||||||
void uv__process_close(uv_process_t* handle);
|
void uv__process_close(uv_process_t* handle);
|
||||||
void uv__stream_close(uv_stream_t* handle);
|
void uv__stream_close(uv_stream_t* handle);
|
||||||
void uv__tcp_close(uv_tcp_t* handle);
|
void uv__tcp_close(uv_tcp_t* handle);
|
||||||
|
size_t uv__thread_stack_size(void);
|
||||||
void uv__udp_close(uv_udp_t* handle);
|
void uv__udp_close(uv_udp_t* handle);
|
||||||
void uv__udp_finish_close(uv_udp_t* handle);
|
void uv__udp_finish_close(uv_udp_t* handle);
|
||||||
uv_handle_type uv__handle_type(int fd);
|
uv_handle_type uv__handle_type(int fd);
|
||||||
|
|||||||
@ -168,7 +168,7 @@ void uv_barrier_destroy(uv_barrier_t* barrier) {
|
|||||||
* On Linux, threads created by musl have a much smaller stack than threads
|
* On Linux, threads created by musl have a much smaller stack than threads
|
||||||
* created by glibc (80 vs. 2048 or 4096 kB.) Follow glibc for consistency.
|
* created by glibc (80 vs. 2048 or 4096 kB.) Follow glibc for consistency.
|
||||||
*/
|
*/
|
||||||
static size_t thread_stack_size(void) {
|
size_t uv__thread_stack_size(void) {
|
||||||
#if defined(__APPLE__) || defined(__linux__)
|
#if defined(__APPLE__) || defined(__linux__)
|
||||||
struct rlimit lim;
|
struct rlimit lim;
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ int uv_thread_create_ex(uv_thread_t* tid,
|
|||||||
|
|
||||||
attr = NULL;
|
attr = NULL;
|
||||||
if (stack_size == 0) {
|
if (stack_size == 0) {
|
||||||
stack_size = thread_stack_size();
|
stack_size = uv__thread_stack_size();
|
||||||
} else {
|
} else {
|
||||||
pagesize = (size_t)getpagesize();
|
pagesize = (size_t)getpagesize();
|
||||||
/* Round up to the nearest page boundary. */
|
/* Round up to the nearest page boundary. */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user