Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement MulticastDelegate for event support #2765

Open
ascpixi opened this issue Sep 7, 2023 · 1 comment
Open

Implement MulticastDelegate for event support #2765

ascpixi opened this issue Sep 7, 2023 · 1 comment

Comments

@ascpixi
Copy link
Contributor

ascpixi commented Sep 7, 2023

What is the usecase for this plug
In order to support events, an implementation of multicast delegates is needed. Currently, it seems like the plugs for this class are missing.

Complexity of plug
As a multicast delegate is an invocation list, this should be trivial to implement.

Describe alternatives you've considered
A possible alternative is using a List<T>, where T is the delegate type.

Additional context
Currently, using events results in the following method being unplugged:

1>  Need plug for: System.MulticastDelegate  System.Delegate.InternalAllocLike(System.Delegate)(Plug Signature: System_MulticastDelegate__System_Delegate_InternalAllocLike_System_Delegate_ ).
1>  Static: True
1>  Assembly: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
1>  Called from:
1>System.MulticastDelegate::System.MulticastDelegate NewMulticastDelegate(System.Object[], Int32, Boolean)
1>System.MulticastDelegate::System.Delegate CombineImpl(System.Delegate)
1>System.Delegate::System.Delegate CombineImpl(System.Delegate)

Interestingly enough, Cosmos seems to have a plug related to multicast delegates: https://github.com/CosmosOS/Cosmos/blob/master/source/Cosmos.Core_Plugs/System/DelegateImpl.cs#L35

This is possibly a software regression.

@quajak
Copy link
Member

quajak commented Sep 8, 2023

This looks like a regression, since the plug seems to exist as pointed out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants