Conversation
bagder
reviewed
Aug 3, 2026
There was a problem hiding this comment.
Pull request overview
This PR refactors easy-handle expire timer management by replacing the per-handle linked-list of timeout nodes with a fixed-size struct expire_timers (indexed by expire_id) plus a sorted “next index” chain, while also tracking whether the handle’s timer node is currently registered in the multi’s splay tree.
Changes:
- Replaces
timeoutlist/time_nodestate withstruct expire_timers(time array + next array +firstindex +registeredflag). - Updates multi timer scheduling to reinsert handles into the splay tree using the new indexed structure.
- Updates verbose tracing/logging to iterate timers via the new
expire_timerschain.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/urldata.h | Introduces struct expire_timers and replaces old per-handle timeout list state. |
| lib/multiif.h | Renames the Curl_expire_ex parameter to match the new naming (eid). |
| lib/multi.c | Implements the new timer list mechanics and integrates them with the multi splay-tree scheduling. |
| lib/curl_trc.c | Updates timer tracing to iterate via expire_timers instead of a linked list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vszakats
pushed a commit
to vszakats/curl
that referenced
this pull request
Aug 4, 2026
Replace the `timeoutlist` and time nodes for expire timers with `struct expire_timers` that keeps a time and next array. There is only ever one timeout per timer id and a fully dynamic list is not needed. Do the sorting by keeping an array of 'next' indiced and a 'first' starting point. Added tracking of splay tree status. Fixed missing splay removal when last timeout was removed via Curl_expire_done(). Some more bytes saved for the DRAM crisis. Closes curl#22473
Member
|
Just waiting for #22513 to merge first! |
Replace the `timeoutlist` and time nodes for expire timers with `struct expire_timers` that keeps a time and next array. There is only ever one timeout per timer id and a fully dynamic list is not needed. Do the sorting by keeping an array of 'next' indiced and a 'first' starting point. Added tracking of splay tree status. Fixed missing splay removal when last timeout was removed via Curl_expire_done().
bagder
approved these changes
Aug 10, 2026
Member
|
This PR trimmed off 1728 bytes from the "maximum allocated" in the "download 512K HTTP" test.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the
timeoutlistand time nodes for expire timers withstruct expire_timersthat keeps a time and next array.There is only ever one timeout per timer id and a fully dynamic list is not needed. Do the sorting by keeping an array of 'next' indiced and a 'first' starting point.
Added tracking of splay tree status.
Fixed missing splay removal when last timeout was removed via Curl_expire_done().
Some more bytes saved for the DRAM crisis.