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

@ -606,7 +606,9 @@ bool _tf_ssb_update_message_id(sqlite3* db, const char* old_id, const char* new_
bool tf_ssb_db_check(sqlite3* db, const char* check_author)
{
JSRuntime* runtime = JS_NewRuntime();
JSMallocFunctions funcs = { 0 };
tf_get_js_malloc_functions(&funcs);
JSRuntime* runtime = JS_NewRuntime2(&funcs, NULL);
JSContext* context = JS_NewContext(runtime);
sqlite3_stmt* statement = NULL;