File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -551,6 +551,22 @@ def event_chains(self) -> list[list[int]]:
551551 complete .extend (open_chains .values ())
552552 return complete
553553
554+ def event_chains_at_time (self , eid_cutoff : int ) -> list [list [int ]]:
555+ """Returns each chain of events: the allocation, followed by any reallocs, followed by any free (if one exists)
556+
557+ Returns only the chains that were alive at the time of the given event
558+ """
559+
560+ def is_alive (chain : list [int ]) -> bool :
561+ start_eid = chain [0 ]
562+ end_eid = chain [- 1 ]
563+ is_released = self .event_table [end_eid ].type == EventType .FREE
564+ return start_eid <= eid_cutoff and (
565+ (not is_released ) or eid_cutoff <= end_eid
566+ )
567+
568+ return list (filter (is_alive , self .event_chains ()))
569+
554570@dataclass
555571class ObjectTree :
556572 type_name : str
You can’t perform that action at this time.
0 commit comments