File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ jl_combined_results g_combined_results; // Will live forever.
46
46
47
47
// === stack stuff ===
48
48
49
- jl_raw_backtrace_t get_raw_backtrace () {
49
+ jl_raw_backtrace_t get_raw_backtrace () JL_NOTSAFEPOINT {
50
50
// A single large buffer to record backtraces onto
51
51
static jl_bt_element_t static_bt_data[JL_MAX_BT_SIZE];
52
52
@@ -120,7 +120,8 @@ JL_DLLEXPORT void jl_free_alloc_profile() {
120
120
121
121
void _maybe_record_alloc_to_profile (jl_value_t *val, size_t size) JL_NOTSAFEPOINT {
122
122
auto & global_profile = g_alloc_profile;
123
- auto & profile = global_profile.per_thread_profiles [jl_threadid ()];
123
+ auto thread_id = jl_atomic_load_relaxed (&jl_current_task->tid );
124
+ auto & profile = global_profile.per_thread_profiles [thread_id];
124
125
125
126
auto sample_val = double (rand ()) / double (RAND_MAX);
126
127
auto should_record = sample_val <= global_profile.sample_rate ;
You can’t perform that action at this time.
0 commit comments