Skip to content

Commit bd58e0c

Browse files
NHDalyKristofferC
authored andcommitted
Fix build warning in gc-alloc-profiler.cpp: cast to (size_t) (#44180)
`std::vector::size()` returns a `size_t`, so we need to cast the int `jl_n_threads` to a `size_t` for the comparison. (cherry picked from commit 15dcd5b)
1 parent 9e634bc commit bd58e0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gc-alloc-profiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extern "C" { // Needed since these functions doesn't take any arguments.
7171

7272
JL_DLLEXPORT void jl_start_alloc_profile(double sample_rate) {
7373
// We only need to do this once, the first time this is called.
74-
while (g_alloc_profile.per_thread_profiles.size() < jl_n_threads) {
74+
while (g_alloc_profile.per_thread_profiles.size() < (size_t)jl_n_threads) {
7575
g_alloc_profile.per_thread_profiles.push_back(jl_per_thread_alloc_profile_t{});
7676
}
7777

0 commit comments

Comments
 (0)