diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2025-07-08 16:33:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-08 16:33:02 +0200 |
commit | 0070322ef2275aaf822459119cf7b9c8b4e88364 (patch) | |
tree | bfaf86be98364c41732dd598d57f892c6e885a3c | |
parent | b36dc711e69193db0204f254461f139dd82e096c (diff) | |
download | libuv-0070322ef2275aaf822459119cf7b9c8b4e88364.tar.gz libuv-0070322ef2275aaf822459119cf7b9c8b4e88364.zip |
win: move uv__insert_pending_req to core.c (#4828)
Large-ish functions with many call sites in different translation units
should not be `static inline`, that just results in lots of code
duplication which the linker may or may not deduplicate. When it does,
the linker has to do extra work; when it doesn't, binaries get bigger.
Refs: https://github.com/libuv/libuv/issues/4819
-rw-r--r-- | src/win/core.c | 23 | ||||
-rw-r--r-- | src/win/req-inl.h | 23 |
2 files changed, 24 insertions, 22 deletions
diff --git a/src/win/core.c b/src/win/core.c index 989c73dd..317238fd 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -854,3 +854,26 @@ int uv__getsockpeername(const uv_handle_t* handle, return 0; } + +void uv__insert_pending_req(uv_loop_t* loop, uv_req_t* req) { + req->next_req = NULL; + if (loop->pending_reqs_tail) { +#ifdef _DEBUG + /* Ensure the request is not already in the queue, or the queue + * will get corrupted. + */ + uv_req_t* current = loop->pending_reqs_tail; + do { + assert(req != current); + current = current->next_req; + } while (current != loop->pending_reqs_tail); +#endif + + req->next_req = loop->pending_reqs_tail->next_req; + loop->pending_reqs_tail->next_req = req; + loop->pending_reqs_tail = req; + } else { + req->next_req = req; + loop->pending_reqs_tail = req; + } +} diff --git a/src/win/req-inl.h b/src/win/req-inl.h index c1ca8ea4..af6fb752 100644 --- a/src/win/req-inl.h +++ b/src/win/req-inl.h @@ -81,27 +81,6 @@ uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); \ } -INLINE static void uv__insert_pending_req(uv_loop_t* loop, uv_req_t* req) { - req->next_req = NULL; - if (loop->pending_reqs_tail) { -#ifdef _DEBUG - /* Ensure the request is not already in the queue, or the queue - * will get corrupted. - */ - uv_req_t* current = loop->pending_reqs_tail; - do { - assert(req != current); - current = current->next_req; - } while(current != loop->pending_reqs_tail); -#endif - - req->next_req = loop->pending_reqs_tail->next_req; - loop->pending_reqs_tail->next_req = req; - loop->pending_reqs_tail = req; - } else { - req->next_req = req; - loop->pending_reqs_tail = req; - } -} +void uv__insert_pending_req(uv_loop_t* loop, uv_req_t* req); #endif /* UV_WIN_REQ_INL_H_ */ |