Track our own quickjs memory usage so that we can avoid expensive calls to JS_ComputeMemoryUsage.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3915 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-20 17:57:07 +00:00
parent f69e74ce53
commit c9e01f220d
5 changed files with 81 additions and 9 deletions

View File

@ -1724,7 +1724,9 @@ tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, sqlite3* db, const
else
{
ssb->own_context = true;
ssb->runtime = JS_NewRuntime();
JSMallocFunctions funcs = { 0 };
tf_get_js_malloc_functions(&funcs);
ssb->runtime = JS_NewRuntime2(&funcs, NULL);
ssb->context = JS_NewContext(ssb->runtime);
}