Skip to content

Remove unused element from pthread struct. NFC#26568

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:slimmer_pthreads
Open

Remove unused element from pthread struct. NFC#26568
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:slimmer_pthreads

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Mar 27, 2026

This reduces the memory overhead of a pthread from 124 bytes to 100 bytes (~20%) saving.

This change was created mostly by Gemini CLI.

This reduces the memory overhead of a pthread from 124 bytes to 100
bytes (~20%) saving.
@sbc100 sbc100 requested a review from kripken March 27, 2026 21:00
@kripken
Copy link
Copy Markdown
Member

kripken commented Mar 27, 2026

Is this worth increasing the diff vs. musl? Generally there are not many pthreads, so we are talking dozens of bytes, maybe hundreds?

@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Mar 28, 2026

Is this worth increasing the diff vs. musl? Generally there are not many pthreads, so we are talking dozens of bytes, maybe hundreds?

I was kind of hoping we could add this struct to the TLS area of Wasm Workers.. so that wasm workers could use pthread_mutex_lock etc. I imagined that @juj would like this to be as small as possible to avoid growing the size of the wasm worker allocations, but maybe ~50 bytes per works is not significant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants