From 9796ab9b004f8c6fe1299efa4e39d6884979e2fb Mon Sep 17 00:00:00 2001 From: andycall Date: Sat, 17 May 2025 07:49:19 +0800 Subject: [PATCH] Make js_class_id_alloc thread-local to avoid the 1 << 16 maximum size limit in JS_NewClass --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index b524353..4d07b09 100644 --- a/quickjs.c +++ b/quickjs.c @@ -1293,7 +1293,7 @@ static const JSClassExoticMethods js_arguments_exotic_methods; static const JSClassExoticMethods js_string_exotic_methods; static const JSClassExoticMethods js_proxy_exotic_methods; static const JSClassExoticMethods js_module_ns_exotic_methods; -static JSClassID js_class_id_alloc = JS_CLASS_INIT_COUNT; +static _Thread_local JSClassID js_class_id_alloc = JS_CLASS_INIT_COUNT; static void js_trigger_gc(JSRuntime *rt, size_t size) {