Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteEvent() [17/18]

unsafe void System.Diagnostics.Tracing.EventSource.WriteEvent ( int eventId,
string? arg1,
string? arg2 )
inlineprotectedinherited

Definition at line 657 of file EventSource.cs.

658 {
659 //The blocks IL_0040 are reachable both inside and outside the pinned region starting at IL_003d. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
660 if (!IsEnabled())
661 {
662 return;
663 }
664 if (arg1 == null)
665 {
666 arg1 = "";
667 }
668 if (arg2 == null)
669 {
670 arg2 = "";
671 }
672 fixed (char* ptr3 = arg1)
673 {
674 char* intPtr;
675 if (arg2 == null)
676 {
677 char* ptr;
678 intPtr = (ptr = null);
679 EventData* ptr2 = stackalloc EventData[2];
680 ptr2->DataPointer = (IntPtr)ptr3;
681 ptr2->Size = (arg1.Length + 1) * 2;
682 ptr2->Reserved = 0;
683 ptr2[1].DataPointer = (IntPtr)ptr;
684 ptr2[1].Size = (arg2.Length + 1) * 2;
685 ptr2[1].Reserved = 0;
687 return;
688 }
689 fixed (char* ptr4 = &arg2.GetPinnableReference())
690 {
691 char* ptr;
692 intPtr = (ptr = ptr4);
693 EventData* ptr2 = stackalloc EventData[2];
694 ptr2->DataPointer = (IntPtr)ptr3;
695 ptr2->Size = (arg1.Length + 1) * 2;
696 ptr2->Reserved = 0;
697 ptr2[1].DataPointer = (IntPtr)ptr;
698 ptr2[1].Size = (arg2.Length + 1) * 2;
699 ptr2[1].Reserved = 0;
701 }
702 }
703 }
unsafe void WriteEventCore(int eventId, int eventDataCount, EventData *data)

References System.Diagnostics.Tracing.EventSource.IsEnabled(), and System.Diagnostics.Tracing.EventSource.WriteEventCore().