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,3 +1,4 @@
#include "mem.h"
#include "ssb.h"
#include "ssb.db.h"
#include "ssb.import.h"
@ -431,8 +432,8 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
}
if (args.count > 1)
{
uv_thread_t* threads = malloc(sizeof(uv_thread_t) * args.count);
tf_run_thread_data_t* data = malloc(sizeof(tf_run_thread_data_t) * args.count);
uv_thread_t* threads = tf_malloc(sizeof(uv_thread_t) * args.count);
tf_run_thread_data_t* data = tf_malloc(sizeof(tf_run_thread_data_t) * args.count);
for (int i = 0 ; i < args.count; i++)
{
data[i] = (tf_run_thread_data_t)
@ -450,8 +451,8 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
result = data[i].result;
}
}
free(data);
free(threads);
tf_free(data);
tf_free(threads);
}
return result;
@ -628,8 +629,8 @@ int main(int argc, char* argv[])
#if !defined(_WIN32)
prctl(PR_SET_PDEATHSIG, SIGKILL);
#endif
tf_util_replace_uv_allocator();
tf_util_replace_tls_allocator();
tf_mem_replace_uv_allocator();
tf_mem_replace_tls_allocator();
uv_setup_args(argc, argv);
tf_taskstub_startup();