From a154b1c2f6e1e05466b60161545cdd415bd81fbb Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 9 Jul 2022 20:46:24 +0000 Subject: [PATCH] Fix the windows build. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3926 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/main.c | 2 ++ src/task.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index d7bd10e9..2dcd004d 100644 --- a/src/main.c +++ b/src/main.c @@ -625,10 +625,12 @@ static int _tf_command_usage(const char* file, int argc, char* argv[]) return 0; } +#if !defined(_WIN32) static void _do_leak_checks(int sig) { VALGRIND_DO_LEAK_CHECK; } +#endif int main(int argc, char* argv[]) { diff --git a/src/task.c b/src/task.c index 024f292a..1e3fb899 100644 --- a/src/task.c +++ b/src/task.c @@ -722,8 +722,10 @@ static JSValue _tf_task_getStats(JSContext* context, JSValueConst this_val, int JS_SetPropertyStr(context, result, "tls_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_tls_malloc_size() / total_memory)); JS_SetPropertyStr(context, result, "tf_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_tf_malloc_size() / total_memory)); +#if !defined(_WIN32) struct mallinfo mi = mallinfo(); JS_SetPropertyStr(context, result, "arena_percent", JS_NewFloat64(context, 100.0f * mi.arena / total_memory)); +#endif JS_SetPropertyStr(context, result, "socket_count", JS_NewInt32(context, tf_socket_get_count())); JS_SetPropertyStr(context, result, "socket_open_count", JS_NewInt32(context, tf_socket_get_open_count()));