Use a custom allocator for everything.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3892 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-04 17:04:51 +00:00
parent cf61e68713
commit 9c90b2bc1d
24 changed files with 404 additions and 343 deletions

View File

@ -1,5 +1,6 @@
#include "tlscontext.js.h"
#include "mem.h"
#include "task.h"
#include "tls.h"
@ -78,7 +79,7 @@ int tf_tls_context_get_count()
JSValue _tls_context_create(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_tls_context_t* tls = malloc(sizeof(tf_tls_context_t));
tf_tls_context_t* tls = tf_malloc(sizeof(tf_tls_context_t));
memset(tls, 0, sizeof(*tls));
++_count;
@ -104,5 +105,5 @@ void _tls_context_finalizer(JSRuntime *runtime, JSValue value)
tls->context = NULL;
}
--_count;
free(tls);
tf_free(tls);
}