file_stream: solidify retry mechanism; df: multiline controls for text_cache-based info, begin porting over txti-based systems

This commit is contained in:
Ryan Fleury
2024-03-28 09:36:09 -07:00
parent 96ff5efe7c
commit dbb0c1e0a4
9 changed files with 252 additions and 29 deletions
+4 -3
View File
@@ -84,7 +84,7 @@ hs_submit_data(U128 key, Arena **data_arena, String8 data)
HS_Stripe *stripe = &hs_shared->stripes[stripe_idx];
//- rjf: commit data to cache - if already there, just bump key refcount
OS_MutexScopeW(stripe->rw_mutex)
ProfScope("commit data to cache - if already there, just bump key refcount") OS_MutexScopeW(stripe->rw_mutex)
{
HS_Node *existing_node = 0;
for(HS_Node *n = slot->first; n != 0; n = n->next)
@@ -123,7 +123,7 @@ hs_submit_data(U128 key, Arena **data_arena, String8 data)
//- rjf: commit this hash to key cache
U128 key_expired_hash = {0};
OS_MutexScopeW(key_stripe->rw_mutex)
ProfScope("commit this hash to key cache") OS_MutexScopeW(key_stripe->rw_mutex)
{
HS_KeyNode *key_node = 0;
for(HS_KeyNode *n = key_slot->first; n != 0; n = n->next)
@@ -152,7 +152,8 @@ hs_submit_data(U128 key, Arena **data_arena, String8 data)
}
//- rjf: if this key's history cache was full, dec key ref count of oldest hash
if(!u128_match(key_expired_hash, u128_zero()))
ProfScope("if this key's history cache was full, dec key ref count of oldest hash")
if(!u128_match(key_expired_hash, u128_zero()))
{
U64 old_hash_slot_idx = key_expired_hash.u64[1]%hs_shared->slots_count;
U64 old_hash_stripe_idx = old_hash_slot_idx%hs_shared->stripes_count;