forked from cory/tildefriends
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:
13
src/main.c
13
src/main.c
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user