Skip to content

asyn-thread: do not allocate thread_data separately#16241

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/thread_data
Closed

asyn-thread: do not allocate thread_data separately#16241
bagder wants to merge 1 commit intomasterfrom
bagder/thread_data

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Feb 7, 2025

Put the full struct into Curl_async since it will be used for every name resolve anyway.

cherry-picked from #16219

@bagder bagder added the name lookup DNS and related tech label Feb 7, 2025
@testclutch

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
@bagder bagder force-pushed the bagder/thread_data branch from d6d0f32 to 2928725 Compare February 9, 2025 10:36
@bagder
Copy link
Copy Markdown
Member Author

bagder commented Feb 11, 2025

I'll merge this after 8.12.1 ships, for added safety.

@bagder bagder closed this in d9fc64d Feb 13, 2025
@bagder bagder deleted the bagder/thread_data branch February 13, 2025 14:36
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants