Skip to content

Commit

Permalink
alloc profiler: fix analyzegc error (JuliaLang#43875)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilterp authored and LilithHafner committed Mar 8, 2022
1 parent 545336f commit db04c0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gc-alloc-profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jl_combined_results g_combined_results; // Will live forever.

// === stack stuff ===

jl_raw_backtrace_t get_raw_backtrace() {
jl_raw_backtrace_t get_raw_backtrace() JL_NOTSAFEPOINT {
// A single large buffer to record backtraces onto
static jl_bt_element_t static_bt_data[JL_MAX_BT_SIZE];

Expand Down Expand Up @@ -120,7 +120,8 @@ JL_DLLEXPORT void jl_free_alloc_profile() {

void _maybe_record_alloc_to_profile(jl_value_t *val, size_t size) JL_NOTSAFEPOINT {
auto& global_profile = g_alloc_profile;
auto& profile = global_profile.per_thread_profiles[jl_threadid()];
auto thread_id = jl_atomic_load_relaxed(&jl_current_task->tid);
auto& profile = global_profile.per_thread_profiles[thread_id];

auto sample_val = double(rand()) / double(RAND_MAX);
auto should_record = sample_val <= global_profile.sample_rate;
Expand Down

0 comments on commit db04c0e

Please sign in to comment.