Skip to content

[Memory64] pthread libc changes for 64-bit #15229

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
Oct 8, 2021

Conversation

aardappel
Copy link
Collaborator

No description provided.

@aardappel aardappel requested a review from kripken October 4, 2021 23:37
@@ -164,7 +161,7 @@ static void _do_call(em_queued_call* q) {
break;
case EM_PROXIED_JS_FUNCTION:
q->returnValue.d =
emscripten_receive_on_main_thread_js((int)q->functionPtr, q->args[0].i, &q->args[1].d);
emscripten_receive_on_main_thread_js((int)(size_t)q->functionPtr, q->args[0].i, &q->args[1].d);
Copy link
Collaborator

Choose a reason for hiding this comment

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

intptr_t there to avoid the double cast?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On 64-bit, intptr_t would cast from 64 to 64, so would still need a secondary cast?

int __i[10];
volatile int __vi[10];
unsigned __s[10];
} __u;
#ifdef __EMSCRIPTEN__
Copy link
Member

Choose a reason for hiding this comment

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

Why does the 11 change to 10?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the 11 field is the pointer below.

@@ -114,7 +119,7 @@ typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __
#endif

#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
Copy link
Member

Choose a reason for hiding this comment

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

Why the new constants 14 and 7? I can't see how doubling a pointer size leads to such things, so I'm missing something...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aardappel
Copy link
Collaborator Author

This now contains a small JS change from #15222 because they can't work independently

@aardappel aardappel enabled auto-merge (squash) October 7, 2021 21:47
@aardappel aardappel force-pushed the b12 branch 2 times, most recently from 7bab09c to b1830cd Compare October 7, 2021 23:23
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