adjust expiration timeouts for searches; fix unnecessary lowercasing when generating paths from pdbs

This commit is contained in:
Ryan Fleury
2025-10-23 16:41:08 -07:00
parent 7a5784b5f0
commit b1a91b8247
4 changed files with 49 additions and 20 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ internal void access_touch(Access *access, AccessPt *pt, CondVar cv);
//- rjf: access points
internal B32 access_pt_is_expired_(AccessPt *pt, AccessPtExpireParams *params);
#define access_pt_is_expired(pt, ...) access_pt_is_expired_((pt), &(AccessPtExpireParams){.time = 2000000, .update_idxs = 10, __VA_ARGS__})
#define access_pt_is_expired(pt, ...) access_pt_is_expired_((pt), &(AccessPtExpireParams){.time = 2000000, .update_idxs = 2, __VA_ARGS__})
//- rjf: progress counters
#define set_progress_ptr(ptr) (tctx_selected()->progress_counter_ptr = (ptr))
+1 -1
View File
@@ -1504,7 +1504,7 @@ di_search_item_array_from_target_query(Access *access, RDI_SectionKind target, S
String8 key = str8_list_join(scratch.arena, &key_parts, 0);
// rjf: get artifact
AC_Artifact artifact = ac_artifact_from_key(access, key, di_search_artifact_create, di_search_artifact_destroy, endt_us, .gen = di_load_gen(), .flags = AC_Flag_Wide, .stale_out = stale_out);
AC_Artifact artifact = ac_artifact_from_key(access, key, di_search_artifact_create, di_search_artifact_destroy, endt_us, .gen = di_load_gen(), .flags = AC_Flag_Wide, .evict_threshold_us = 100000, .stale_out = stale_out);
// rjf: unpack artifact
result.v = (DI_SearchItem *)artifact.u64[2];
+18 -18
View File
@@ -1002,30 +1002,30 @@ p2r_convert(Arena *arena, P2R_ConvertParams *params)
checksum_value.size = Min(checksum->len, checksum_value.size);
}
// rjf: file name -> normalized file path
String8 file_path = seq_file_name;
String8 file_path_normalized = lower_from_str8(scratch2.arena, str8_skip_chop_whitespace(file_path));
// rjf: file name -> sanitized file path
String8 file_path = seq_file_name;
String8 file_path_sanitized = str8_copy(scratch2.arena, str8_skip_chop_whitespace(file_path));
{
PathStyle file_path_normalized_style = path_style_from_str8(file_path_normalized);
String8List file_path_normalized_parts = str8_split_path(scratch2.arena, file_path_normalized);
if(file_path_normalized_style == PathStyle_Relative)
PathStyle file_path_sanitized_style = path_style_from_str8(file_path_sanitized);
String8List file_path_sanitized_parts = str8_split_path(scratch2.arena, file_path_sanitized);
if(file_path_sanitized_style == PathStyle_Relative)
{
String8List obj_folder_path_parts = str8_split_path(scratch2.arena, obj_folder_path);
str8_list_concat_in_place(&obj_folder_path_parts, &file_path_normalized_parts);
file_path_normalized_parts = obj_folder_path_parts;
file_path_normalized_style = path_style_from_str8(obj_folder_path);
str8_list_concat_in_place(&obj_folder_path_parts, &file_path_sanitized_parts);
file_path_sanitized_parts = obj_folder_path_parts;
file_path_sanitized_style = path_style_from_str8(obj_folder_path);
}
str8_path_list_resolve_dots_in_place(&file_path_normalized_parts, file_path_normalized_style);
file_path_normalized = str8_path_list_join_by_style(scratch2.arena, &file_path_normalized_parts, file_path_normalized_style);
str8_path_list_resolve_dots_in_place(&file_path_sanitized_parts, file_path_sanitized_style);
file_path_sanitized = str8_path_list_join_by_style(scratch2.arena, &file_path_sanitized_parts, file_path_sanitized_style);
}
// rjf: normalized file path -> source file node
U64 file_path_normalized_hash = rdi_hash(file_path_normalized.str, file_path_normalized.size);
U64 hit_path_slot = file_path_normalized_hash%hit_path_slots_count;
// rjf: sanitized file path -> source file node
U64 file_path_sanitized_hash = rdi_hash(file_path_sanitized.str, file_path_sanitized.size);
U64 hit_path_slot = file_path_sanitized_hash%hit_path_slots_count;
String8Node *hit_path_node = 0;
for(String8Node *n = hit_path_slots[hit_path_slot]; n != 0; n = n->next)
{
if(str8_match(n->string, file_path_normalized, 0))
if(str8_match(n->string, file_path_sanitized, 0))
{
hit_path_node = n;
break;
@@ -1035,11 +1035,11 @@ p2r_convert(Arena *arena, P2R_ConvertParams *params)
{
hit_path_node = push_array(scratch2.arena, String8Node, 1);
SLLStackPush(hit_path_slots[hit_path_slot], hit_path_node);
hit_path_node->string = file_path_normalized;
P2R_SrcFileStubNode *stub_n = push_array(scratch.arena, P2R_SrcFileStubNode, 1);
hit_path_node->string = file_path_sanitized;
P2R_SrcFileStubNode *stub_n = push_array(scratch2.arena, P2R_SrcFileStubNode, 1);
SLLQueuePush(first_src_file_stub, last_src_file_stub, stub_n);
src_file_stub_count += 1;
stub_n->v.file_path = str8_copy(scratch.arena, file_path_normalized);
stub_n->v.file_path = str8_copy(scratch.arena, file_path_sanitized);
stub_n->v.checksum_kind = checksum_kind;
stub_n->v.checksum = str8_copy(scratch.arena, checksum_value);
}