mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 22:38:41 +00:00
speed up symbol patching
This commit is contained in:
@@ -180,7 +180,6 @@ lnk_setup_pch(Arena *arena, U64 obj_count, LNK_Obj **obj_arr, CV_DebugT *debug_t
|
||||
|
||||
String8 obj_path = path_absolute_dst_from_relative_dst_src(scratch.arena, precomp.obj_name, work_dir);
|
||||
|
||||
|
||||
// map obj name in LF_PRECOMP to obj index
|
||||
U64 debug_p_obj_idx = max_U64;
|
||||
if (!hash_table_search_path_u64(debug_p_ht, obj_path, &debug_p_obj_idx)) {
|
||||
@@ -1981,10 +1980,12 @@ lnk_assign_type_indices(TP_Context *tp, LNK_LeafBucketArray bucket_arr, CV_TypeI
|
||||
internal
|
||||
THREAD_POOL_TASK_FUNC(lnk_patch_symbols_task)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
LNK_PatchSymbolTypesTask *task = raw_task;
|
||||
Arena *fixed_arena = task->arena_arr[worker_id];
|
||||
LNK_CodeViewSymbolsInput symbol_input = task->input->symbol_inputs[task_id];
|
||||
Arena *fixed_arena = task->arena_arr[task_id];
|
||||
|
||||
for EachInRange(symbol_input_idx, task->ranges[task_id]) {
|
||||
LNK_CodeViewSymbolsInput symbol_input = task->input->symbol_inputs[symbol_input_idx];
|
||||
LNK_LeafLocType loc_type = lnk_loc_type_from_obj_idx(task->input, symbol_input.obj_idx);
|
||||
U64 loc_idx = lnk_loc_idx_from_obj_idx(task->input, symbol_input.obj_idx);
|
||||
|
||||
@@ -2015,6 +2016,8 @@ THREAD_POOL_TASK_FUNC(lnk_patch_symbols_task)
|
||||
temp_end(temp);
|
||||
}
|
||||
}
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
internal void
|
||||
lnk_patch_symbols(TP_Context *tp,
|
||||
@@ -2028,11 +2031,12 @@ lnk_patch_symbols(TP_Context *tp,
|
||||
U64 max_ti_list_size = sizeof(CV_TypeIndexInfo) * (max_U16 / sizeof(CV_TypeIndex));
|
||||
|
||||
LNK_PatchSymbolTypesTask task = {0};
|
||||
task.ranges = tp_divide_work(scratch.arena, input->total_symbol_input_count, tp->worker_count);
|
||||
task.input = input;
|
||||
task.hashes = hashes;
|
||||
task.leaf_ht_arr = leaf_ht_arr;
|
||||
task.arena_arr = alloc_fixed_size_arena_array(scratch.arena, tp->worker_count, max_ti_list_size, max_ti_list_size);
|
||||
tp_for_parallel(tp, 0, input->total_symbol_input_count, lnk_patch_symbols_task, &task);
|
||||
tp_for_parallel(tp, 0, tp->worker_count, lnk_patch_symbols_task, &task);
|
||||
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
|
||||
@@ -236,6 +236,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Rng1U64 *ranges;
|
||||
LNK_CodeViewInput *input;
|
||||
LNK_LeafHashes *hashes;
|
||||
LNK_LeafHashTable *leaf_ht_arr;
|
||||
|
||||
Reference in New Issue
Block a user