Skip to content

Commit 59f1534

Browse files
authored
Changed realloc to calloc to avoid issues with non-initialization. (#40225)
1 parent 2ec75d6 commit 59f1534

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/threading.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ void jl_init_threading(void)
398398
}
399399
if (jl_n_threads <= 0)
400400
jl_n_threads = 1;
401-
jl_measure_compile_time = (uint8_t*)realloc(jl_measure_compile_time, jl_n_threads * sizeof(*jl_measure_compile_time));
402-
jl_cumulative_compile_time = (uint64_t*)realloc(jl_cumulative_compile_time, jl_n_threads * sizeof(*jl_cumulative_compile_time));
401+
jl_measure_compile_time = (uint8_t*)calloc(jl_n_threads, sizeof(*jl_measure_compile_time));
402+
jl_cumulative_compile_time = (uint64_t*)calloc(jl_n_threads, sizeof(*jl_cumulative_compile_time));
403403
#ifndef __clang_analyzer__
404404
jl_all_tls_states = (jl_ptls_t*)calloc(jl_n_threads, sizeof(void*));
405405
#endif

0 commit comments

Comments
 (0)