fix artifact cache replaced-value deletion - this CAN NOT run if the new value == the old value

This commit is contained in:
Ryan Fleury
2026-05-11 13:29:29 -07:00
parent 52da228efe
commit de35a86505
8 changed files with 142 additions and 26 deletions
+6 -4
View File
@@ -422,12 +422,13 @@ ac_async_tick(void)
{
if(str8_match(n->key, r->key, 0))
{
// rjf: eliminate existing values, if nay
if(cache->destroy && ins_atomic_u64_eval(&n->completion_count) > 0) for(;;)
// rjf: eliminate existing values, if any, if they do not match the current
if(!MemoryMatchStruct(&n->val, &val) && ins_atomic_u64_eval(&n->completion_count) > 0) for(;;)
{
if(access_pt_is_expired(&n->access_pt, .time = 0, .update_idxs = 0))
{
cache->destroy(n->val);
MemoryZeroStruct(&n->val);
break;
}
cond_var_wait_rw(stripe->cv, stripe->rw_mutex, 1, max_U64);
@@ -543,12 +544,13 @@ ac_async_tick(void)
{
if(str8_match(n->key, r->key, 0))
{
// rjf: eliminate existing values, if nay
if(cache->destroy && ins_atomic_u64_eval(&n->completion_count) > 0) for(;;)
// rjf: eliminate existing values, if any, if they do not match the current
if(!MemoryMatchStruct(&n->val, &val) && ins_atomic_u64_eval(&n->completion_count) > 0) for(;;)
{
if(access_pt_is_expired(&n->access_pt, .time = 0, .update_idxs = 0))
{
cache->destroy(n->val);
MemoryZeroStruct(&n->val);
break;
}
cond_var_wait_rw(stripe->cv, stripe->rw_mutex, 1, max_U64);