Skip to content

Commit

Permalink
Added interface constraint to burst wrapper Send method
Browse files Browse the repository at this point in the history
  • Loading branch information
bustedbunny committed Apr 5, 2023
1 parent 110b2ca commit 67d3902
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Runtime/Messaging/BurstWrapper/MessengerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct MessengerWrapper
{
internal NativeList<byte> data;

public unsafe void Send<T>(T message) where T : unmanaged
public unsafe void Send<T>(T message) where T : unmanaged, IUnmanagedMessage
{
var size = sizeof(T);
var hash = BurstRuntime.GetHashCode64<T>();
Expand All @@ -30,7 +30,7 @@ public struct Parallel
internal NativeList<byte>.ParallelWriter data;

[Preserve]
public unsafe void Send<T>(T message) where T : unmanaged
public unsafe void Send<T>(T message) where T : unmanaged, IUnmanagedMessage
{
var size = sizeof(T);
var hash = BurstRuntime.GetHashCode64<T>();
Expand Down

0 comments on commit 67d3902

Please sign in to comment.