Skip to content

Commit

Permalink
fix type error (#44235)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilterp authored Feb 18, 2022
1 parent 77d401f commit 123cf78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gc-alloc-profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ jl_raw_backtrace_t get_raw_backtrace() JL_NOTSAFEPOINT {
// per-thread backtrace buffer.
jl_ptls_t ptls = jl_current_task->ptls;
jl_bt_element_t *shared_bt_data_buffer = ptls->profiling_bt_buffer;
if (shared_bt_data_buffer == NULL)
ptls->profiling_bt_buffer = shared_bt_data_buffer = \
malloc_s(sizeof(jl_bt_element_t) * (JL_MAX_BT_SIZE + 1));
if (shared_bt_data_buffer == NULL) {
size_t size = sizeof(jl_bt_element_t) * (JL_MAX_BT_SIZE + 1);
shared_bt_data_buffer = (jl_bt_element_t*) malloc_s(size);
ptls->profiling_bt_buffer = shared_bt_data_buffer;
}

size_t bt_size = rec_backtrace(shared_bt_data_buffer, JL_MAX_BT_SIZE, 2);

Expand Down

0 comments on commit 123cf78

Please sign in to comment.