From d1541f137845cd0c9b8172b5343937a3b3d7735b Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Wed, 23 Aug 2023 22:17:30 -0700 Subject: [PATCH] Initialize stats array to zero --- flecs.c | 4 ++-- src/addons/stats.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flecs.c b/flecs.c index 1f3f5c3cc..10617d1f7 100644 --- a/flecs.c +++ b/flecs.c @@ -35497,7 +35497,7 @@ bool ecs_pipeline_stats_get( int32_t i, count = ecs_vec_count(ops); if (count) { ecs_vec_init_if_t(&s->sync_points, ecs_sync_stats_t); - ecs_vec_set_count_t(NULL, &s->sync_points, ecs_sync_stats_t, count); + ecs_vec_set_min_count_zeromem_t(NULL, &s->sync_points, ecs_sync_stats_t, count); op = ecs_vec_first_t(ops, ecs_pipeline_op_t); for (i = 0; i < count; i ++) { @@ -35562,7 +35562,7 @@ void ecs_pipeline_stats_reduce( int32_t i, sync_count = ecs_vec_count(&src->sync_points); ecs_vec_init_if_t(&dst->sync_points, ecs_sync_stats_t); - ecs_vec_set_count_t(NULL, &dst->sync_points, ecs_sync_stats_t, sync_count); + ecs_vec_set_min_count_zeromem_t(NULL, &dst->sync_points, ecs_sync_stats_t, sync_count); ecs_sync_stats_t *dst_syncs = ecs_vec_first_t(&dst->sync_points, ecs_sync_stats_t); ecs_sync_stats_t *src_syncs = ecs_vec_first_t(&src->sync_points, ecs_sync_stats_t); for (i = 0; i < sync_count; i ++) { diff --git a/src/addons/stats.c b/src/addons/stats.c index 03b8c4155..7e1f6c993 100644 --- a/src/addons/stats.c +++ b/src/addons/stats.c @@ -617,7 +617,7 @@ bool ecs_pipeline_stats_get( int32_t i, count = ecs_vec_count(ops); if (count) { ecs_vec_init_if_t(&s->sync_points, ecs_sync_stats_t); - ecs_vec_set_count_t(NULL, &s->sync_points, ecs_sync_stats_t, count); + ecs_vec_set_min_count_zeromem_t(NULL, &s->sync_points, ecs_sync_stats_t, count); op = ecs_vec_first_t(ops, ecs_pipeline_op_t); for (i = 0; i < count; i ++) { @@ -682,7 +682,7 @@ void ecs_pipeline_stats_reduce( int32_t i, sync_count = ecs_vec_count(&src->sync_points); ecs_vec_init_if_t(&dst->sync_points, ecs_sync_stats_t); - ecs_vec_set_count_t(NULL, &dst->sync_points, ecs_sync_stats_t, sync_count); + ecs_vec_set_min_count_zeromem_t(NULL, &dst->sync_points, ecs_sync_stats_t, sync_count); ecs_sync_stats_t *dst_syncs = ecs_vec_first_t(&dst->sync_points, ecs_sync_stats_t); ecs_sync_stats_t *src_syncs = ecs_vec_first_t(&src->sync_points, ecs_sync_stats_t); for (i = 0; i < sync_count; i ++) {