asyn-thread: do not allocate thread_data separately#16241
Closed
asyn-thread: do not allocate thread_data separately#16241
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Put the full struct into Curl_async since it will be used for every name resolve anyway. Closes #16241
d6d0f32 to
2928725
Compare
Member
Author
|
I'll merge this after 8.12.1 ships, for added safety. |
vszakats
added a commit
that referenced
this pull request
Mar 15, 2025
seen with mingw-w64 gcc 14.2.0 while playing with other modifications:
```
lib/asyn-thread.c: In function 'init_resolve_thread':
lib/asyn-thread.c:447:5: warning: 'free' called on pointer 'data' with nonzero offset 3264 [-Wfree-nonheap-object]
447 | free(td);
| ^~~~~~~~
```
Where `td` is:
```c
struct thread_data *td = &data->state.async.thdata;
```
Follow-up to d9fc64d #16241
Closes #16734
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Put the full struct into Curl_async since it will be used for every name resolve anyway. Closes curl#16241
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
seen with mingw-w64 gcc 14.2.0 while playing with other modifications:
```
lib/asyn-thread.c: In function 'init_resolve_thread':
lib/asyn-thread.c:447:5: warning: 'free' called on pointer 'data' with nonzero offset 3264 [-Wfree-nonheap-object]
447 | free(td);
| ^~~~~~~~
```
Where `td` is:
```c
struct thread_data *td = &data->state.async.thdata;
```
Follow-up to d9fc64d curl#16241
Closes curl#16734
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.
Put the full struct into Curl_async since it will be used for every name resolve anyway.
cherry-picked from #16219