Skip to content

[embind] Reuse signature codes from em_asm #24611

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RReverser
Copy link
Collaborator

@RReverser RReverser commented Jun 19, 2025

Aside from a minor discrepancy, there is no point in maintaining two separate sets of type pack to signature conversions, especially now that they've grown with wasm64 conditionals. Keeping them in one place reduces complexity in bind.h and ensures the signatures stay in sync.

@RReverser RReverser requested review from brendandahl and sbc100 June 19, 2025 17:47
@RReverser RReverser marked this pull request as draft June 19, 2025 17:57
Aside from a minor discrepancy, there is no point in maintaining two separate sets of type pack to signature conversions, especially now that they've grown with wasm64 conditionals. Keeping them in one place reduces complexity in bind.h and ensures the signatures stay in sync.
@RReverser RReverser marked this pull request as ready for review June 20, 2025 16:11

// TODO: should we add this override to em_asm?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@sbc100 Would love your thoughts on this one. In other places we represent size_t aka unsigned long as number, even though it's 32 bit on wasm32 and 64 on wasm64, so it's lossy on wasm64.

Should we change EM_ASM behaviour to match that, or should we change those other places to prevent precision loss for unsigned long, or is it expected that they handle it differently?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm maybe "most" is an exaggeration. Embind itself also encodes size_t aka unsigned long as a BigInt on wasm64 and number otherwise.

Shame that you can't distinguish between size_t and "plain" longs.

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.

1 participant