Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use shared EightObjects InlineArray #105540

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even
Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}");
EightObjects eightObjectStack = default;
Span<int> refObjPosition = stackalloc int[EtwAPIMaxRefObjCount];
Span<object?> dataRefObj = new Span<object?>(ref eightObjectStack._arg0, EtwAPIMaxRefObjCount);
Span<object?> dataRefObj = eightObjectStack;

EventData* userData = stackalloc EventData[2 * argCount];
for (int i = 0; i < 2 * argCount; i++)
Expand Down Expand Up @@ -653,21 +653,6 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even
return true;
}

/// <summary>Workaround for inability to stackalloc object[EtwAPIMaxRefObjCount == 8].</summary>
private struct EightObjects
{
internal object? _arg0;
#pragma warning disable CA1823, CS0169, IDE0051, IDE0044
private object? _arg1;
private object? _arg2;
private object? _arg3;
private object? _arg4;
private object? _arg5;
private object? _arg6;
private object? _arg7;
#pragma warning restore CA1823, CS0169, IDE0051, IDE0044
}

/// <summary>
/// WriteEvent, method to be used by generated code on a derived class
/// </summary>
Expand Down
Loading