From ca176d4e8b58e1799d9a203b5ceba6427a61a438 Mon Sep 17 00:00:00 2001 From: Juan Campa Date: Mon, 29 Jan 2024 15:43:03 -0500 Subject: [PATCH] Fix memory usage of rt->class_count --- quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickjs.c b/quickjs.c index 2ea44cc..8b007b0 100644 --- a/quickjs.c +++ b/quickjs.c @@ -5839,7 +5839,7 @@ void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s) s->malloc_limit = rt->malloc_state.malloc_limit; s->memory_used_count = 2; /* rt + rt->class_array */ - s->memory_used_size = sizeof(JSRuntime) + sizeof(JSValue) * rt->class_count; + s->memory_used_size = sizeof(JSRuntime) + sizeof(JSClass) * rt->class_count; list_for_each(el, &rt->context_list) { JSContext *ctx = list_entry(el, JSContext, link);