Make js_class_id_alloc thread-local to avoid the 1 << 16 maximum size limit in JS_NewClass

This commit is contained in:
andycall 2025-05-17 07:49:19 +08:00
parent 1021e3c729
commit 9796ab9b00

View File

@ -1293,7 +1293,7 @@ static const JSClassExoticMethods js_arguments_exotic_methods;
static const JSClassExoticMethods js_string_exotic_methods; static const JSClassExoticMethods js_string_exotic_methods;
static const JSClassExoticMethods js_proxy_exotic_methods; static const JSClassExoticMethods js_proxy_exotic_methods;
static const JSClassExoticMethods js_module_ns_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) static void js_trigger_gc(JSRuntime *rt, size_t size)
{ {