Skip to content

Commit

Permalink
unix: expose thread_stack_size() internally
Browse files Browse the repository at this point in the history
This function will be used by `uv__fsevents_loop_init` in a future
commit to determine the initial FSEvents pthread stack size.

PR-URL: libuv#3132
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
  • Loading branch information
gluxon authored and JeffroMF committed May 16, 2022
1 parent 9dbee62 commit ac4d362
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void uv__prepare_close(uv_prepare_t* handle);
void uv__process_close(uv_process_t* handle);
void uv__stream_close(uv_stream_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_finish_close(uv_udp_t* handle);
uv_handle_type uv__handle_type(int fd);
Expand Down
4 changes: 2 additions & 2 deletions src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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__)
struct rlimit lim;

Expand Down Expand Up @@ -234,7 +234,7 @@ int uv_thread_create_ex(uv_thread_t* tid,

attr = NULL;
if (stack_size == 0) {
stack_size = thread_stack_size();
stack_size = uv__thread_stack_size();
} else {
pagesize = (size_t)getpagesize();
/* Round up to the nearest page boundary. */
Expand Down

0 comments on commit ac4d362

Please sign in to comment.