@@ -141,10 +141,6 @@ struct ValueShared {
141
141
/// the value is re-interned with a new ID.
142
142
id : Id ,
143
143
144
- /// The revision the value was first interned in, i.e. the latest revision
145
- /// in which the slot was reused.
146
- first_interned_at : Revision ,
147
-
148
144
/// The revision the value was most-recently interned in.
149
145
last_interned_at : Revision ,
150
146
@@ -343,10 +339,13 @@ where
343
339
}
344
340
345
341
// Record a dependency on the value.
342
+ //
343
+ // Note that we can use `Revision::start()` here as the ID with the given generation
344
+ // is unique to this use of the interned slot.
346
345
zalsa_local. report_tracked_read_simple (
347
346
index,
348
347
value_shared. durability ,
349
- value_shared . first_interned_at ,
348
+ Revision :: start ( ) ,
350
349
) ;
351
350
352
351
return value_shared. id ;
@@ -419,16 +418,17 @@ where
419
418
id : new_id,
420
419
durability,
421
420
last_interned_at,
422
- // Record the revision in which we are re-interning the value.
423
- first_interned_at : current_revision,
424
421
} ;
425
422
426
423
// Record a dependency on the new value.
424
+ //
425
+ // Note that we can use `Revision::start()` here as we just incremented the ID generation,
426
+ // so it as if a new input has been created.
427
427
let index = self . database_key_index ( value_shared. id ) ;
428
428
zalsa_local. report_tracked_read_simple (
429
429
index,
430
430
value_shared. durability ,
431
- value_shared . first_interned_at ,
431
+ Revision :: start ( ) ,
432
432
) ;
433
433
434
434
zalsa. event ( & || {
@@ -546,8 +546,6 @@ where
546
546
id,
547
547
durability,
548
548
last_interned_at,
549
- // Record the revision in which we are re-interning the value.
550
- first_interned_at : current_revision,
551
549
} ) ,
552
550
} ) ;
553
551
@@ -575,7 +573,7 @@ where
575
573
let index = self . database_key_index ( id) ;
576
574
577
575
// Record a dependency on the newly interned value.
578
- zalsa_local. report_tracked_read_simple ( index, durability, current_revision ) ;
576
+ zalsa_local. report_tracked_read_simple ( index, durability, Revision :: start ( ) ) ;
579
577
580
578
zalsa. event ( & || {
581
579
Event :: new ( EventKind :: DidInternValue {
@@ -739,7 +737,7 @@ where
739
737
& self ,
740
738
db : & dyn Database ,
741
739
input : Id ,
742
- revision : Revision ,
740
+ _revision : Revision ,
743
741
_cycle_heads : & mut CycleHeads ,
744
742
) -> VerifyResult {
745
743
let zalsa = db. zalsa ( ) ;
@@ -757,7 +755,7 @@ where
757
755
let value_shared = unsafe { & mut * value. shared . get ( ) } ;
758
756
759
757
// The slot was reused.
760
- if value_shared. first_interned_at > revision {
758
+ if value_shared. id . generation ( ) > input . generation ( ) {
761
759
return VerifyResult :: Changed ;
762
760
}
763
761
0 commit comments