Skip to content

Use global TLS variable in proxying.c. NFC #24596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 17, 2025

There was some suspicion that this might lead to a code size change but it doesn't seem to (I suppose because bool/int doesn't have any code in its constructor).

Also use bool rather than int to better convey intent.

Split out from #24565

@sbc100 sbc100 requested review from brendandahl and tlively June 17, 2025 19:59
@sbc100 sbc100 requested a review from kripken June 17, 2025 20:36
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

Are you planning to update the rest of the file to use bools? It seems best to be consistent one way or the other.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 17, 2025

There is already existing use of stdbool, for example:

.owned = false,

And:

assert(false && "emscripten_proxy_sync failed");

I don't see many more opportunities to use bool without changing the public interfaces, do you?

Also use `bool` rather than `int` to better convey intent.

Split out from emscripten-core#24565
@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 17, 2025

I found one more :)

@tlively
Copy link
Member

tlively commented Jun 17, 2025

Lines 141 and 410 are the other candidates I see.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 17, 2025

Lines 141 and 410 are the other candidates I see.

This don't work so well as they are basically underlying parts of public interfaces that return int.

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

LGTM

@sbc100 sbc100 merged commit c156626 into emscripten-core:main Jun 17, 2025
30 checks passed
@sbc100 sbc100 deleted the prozying branch June 17, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants