Beispiel #1
0
        private void ParseGarbageCollectionStarted(Match match)
        {
            GarbageCollectionGenerations generations = GarbageCollectionGenerations.None;

            if (match.Groups[6].Value == "t")
            {
                generations |= GarbageCollectionGenerations.Generation0;
            }
            if (match.Groups[7].Value == "t")
            {
                generations |= GarbageCollectionGenerations.Generation1;
            }
            if (match.Groups[8].Value == "t")
            {
                generations |= GarbageCollectionGenerations.Generation2;
            }
            if (match.Groups[9].Value == "t")
            {
                generations |= GarbageCollectionGenerations.LargeObjectHeap;
            }
            var result = new GarbageCollectionStarted(
                match.Groups[3].ToUInt64(),
                match.Groups[4].ToUInt64(),
                (match.Groups[5].Value == "?")
                    ? GarbageCollectionReason.Unspecified
                    : GarbageCollectionReason.Induced,
                generations);

            GarbageCollectionStartedCallback?.Invoke(result);
        }
Beispiel #2
0
 public GarbageCollectionStarted(ulong osThreadId, ulong timestamp, GarbageCollectionReason reason,
                                 GarbageCollectionGenerations generations)
 {
     OsThreadId  = osThreadId;
     Timestamp   = timestamp;
     Reason      = reason;
     Generations = generations;
 }