Skip to content

multi: reduce struct size with small cleanups - #22807

Closed
cmeister2 wants to merge 1 commit into
masterfrom
cm2/multi-small-cleanups
Closed

cmeister2 wants to merge 1 commit into
masterfrom
cm2/multi-small-cleanups

Conversation

@cmeister2

@cmeister2 cmeister2 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Use byte-sized multi API call-stack fields, remove the unused uint32
table destructor and replace the last timeout value with a bit.

This reduces Curl_multi by 32 bytes on 64-bit builds.

@github-actions github-actions Bot added the tests label Sep 2, 2026
cmeister2 added a commit that referenced this pull request Sep 2, 2026
Use byte-sized multi API call-stack fields, remove the unused uint32
table destructor, narrow shared buffer lengths to uint32_t and replace
the last timeout value with a bit.

This reduces Curl_multi by 40 bytes on 64-bit builds.

Closes #22807
@cmeister2
cmeister2 force-pushed the cm2/multi-small-cleanups branch from 2bb1c35 to 9f5f723 Compare September 2, 2026 17:25
@bagder
bagder requested a balanced review from Copilot September 3, 2026 09:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The field narrowing is guarded against overflow and the affected behavior has focused unit coverage.

Pull request overview

Reduces Curl_multi memory usage while preserving timer, buffer, API-stack, and table behavior.

Changes:

  • Narrows API-stack and shared-buffer fields.
  • Simplifies timer state and uint32 table initialization.
  • Adds timer and oversized-buffer unit coverage.
File summaries
File Description
lib/api.c Adds byte-width safety checks and conversions.
lib/api.h Narrows multi API stack fields.
lib/multi.c Simplifies timer state and validates buffer size.
lib/multihandle.h Shrinks fields in Curl_multi.
lib/multiif.h Corrects buffer API documentation.
lib/uint-table.c Removes unused destructor handling.
lib/uint-table.h Simplifies the table API and structure.
docs/internals/UINT_SETS.md Updates table memory documentation.
tests/unit/unit3212.c Adapts to the simplified table API.
tests/unit/unit3230.c Tests timer transitions and buffer limits.
tests/unit/Makefile.inc Registers the new unit source.
tests/data/test3230 Defines the new unit test case.
tests/data/Makefile.am Registers test 3230.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Use byte-sized multi API call-stack fields, remove the unused uint32
table destructor and replace the last timeout value with a bit.

This reduces Curl_multi by 32 bytes on 64-bit builds.

Closes #22807

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The size optimizations preserve existing semantics and include focused coverage for the changed timer behavior.

Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@bagder
bagder requested a review from icing September 4, 2026 06:48
@bagder bagder closed this in eab7d91 Sep 4, 2026
@bagder
bagder deleted the cm2/multi-small-cleanups branch September 4, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants