-
Notifications
You must be signed in to change notification settings - Fork 143
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
Don't use _Thread_local in run-test262.c #667
Conversation
JS_SetRuntimeOpaque() and JS_GetRuntimeOpaque() are intended for embedders. Stop using them in quickjs-libc.c
static JSThreadState *js_get_thread_state(JSRuntime *rt) | ||
{ | ||
return (JSThreadState *)js_std_cmd(/*GetOpaque*/0, rt); | ||
} | ||
|
||
static void js_set_thread_state(JSRuntime *rt, JSThreadState *ts) | ||
{ | ||
js_std_cmd(/*SetOpaque*/1, rt, ts); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other approach is a mutex-protected list or hash table but this seemed all around easier.
gcc48 failure is ancient cmake 🤦
|
Allows building with tcc and old gcc versions again.
e574e6c
to
ca4c989
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I wonder if we could (ab)use this weird API: JS_EXTERN void JS_SetRuntimeInfo(JSRuntime *rt, const char *info);
No sweat though, there are a couple of APIs already that are exposed for libc really IIRC.
Yeah, I've seen that one. run-test262 in fact uses it so that wouldn't have worked. |
Allows building with tcc and old gcc versions again.
Please heed the first commit where I unscrupulously add a backdoor so I can use JS_SetRuntimeOpaque in run-test262.c