Conversation
|
augment review |
🤖 Augment PR SummarySummary: Shrinks the per-easy-handle footprint by making the MIME post container optional instead of always embedded. Changes:
Technical Notes: Call sites must now handle 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
This pull request optimizes memory usage in the curl easy handle by converting the mimepost field from an embedded struct to an on-demand allocated pointer. This reduces the size of the easy handle by approximately 432-480 bytes by only allocating the 440-byte mimepost struct when MIME POST functionality is actually used.
Changes:
- Changed
mimepostfrom an embeddedcurl_mimepartstruct to a pointermimepostpinstruct UserDefined - Updated the
IS_MIME_POSTmacro to check pointer presence instead of thekindfield - Modified initialization, cleanup, duplication, and usage code across multiple files to handle the pointer-based approach
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/urldata.h | Changed mimepost from embedded struct to pointer mimepostp, updated IS_MIME_POST macro |
| lib/url.c | Removed initialization of embedded struct, updated cleanup to handle pointer |
| lib/setopt.c | Extracted mime post setup into setopt_mimepost function with on-demand allocation |
| lib/easy.c | Updated duplication logic to allocate and copy mimepost pointer on-demand |
| lib/http.c | Updated to use pointer instead of taking address of embedded struct |
| lib/smtp.c | Updated to use pointer and IS_MIME_POST macro for consistency |
| lib/imap.c | Updated to use pointer and IS_MIME_POST macro for consistency |
| tests/unit/unit3214.c | Updated maximum allowed size for CURL_EASY handle (5850 → 5370 bytes) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f558cd4 to
669aa0e
Compare
This makes the easy handle 432 bytes smaller (totally 5184 bytes on my rather maximized Linux 64 bit build). The 440 byte mimepost struct is now allocated only when needed.
669aa0e to
e37db14
Compare
This makes the easy handle 432 bytes smaller (totally 5352 bytes on my rather maximized Linux 64 bit build). The 440 byte mimepost struct is now allocated only when needed.