You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C# definition for SteamNetworkingMessage_t is (accidentally?) a managed type, which necessitates an unneeded GC allocation and some copies when using it to call SteamNetworkingSockets.SendMessages. See the sample code provided in #598.
The root cause making it a managed type is its SteamNetworkingIdentity field, which is itself a managed type because of its field m_reserved. Until struct inline arrays arrive and can be broadly used (incl. Unity), replacing m_reserved with 32 individual uint fields transitively makes SteamNetworkingMessage_t an unmanaged type.
This one (tedious) code change in SteamNetworkingIdentity allows an optimized call to SteamNetworkingSockets.SendMessages shown in the (unsafe) sample code below. I've tested it successfully at runtime using my other local modifications to Steamworks.NET discussed in #598.
The C# definition for
SteamNetworkingMessage_t
is (accidentally?) a managed type, which necessitates an unneeded GC allocation and some copies when using it to callSteamNetworkingSockets.SendMessages
. See the sample code provided in #598.The root cause making it a managed type is its
SteamNetworkingIdentity
field, which is itself a managed type because of its fieldm_reserved
. Until struct inline arrays arrive and can be broadly used (incl. Unity), replacingm_reserved
with 32 individualuint
fields transitively makesSteamNetworkingMessage_t
an unmanaged type.This one (tedious) code change in
SteamNetworkingIdentity
allows an optimized call toSteamNetworkingSockets.SendMessages
shown in the (unsafe) sample code below. I've tested it successfully at runtime using my other local modifications to Steamworks.NET discussed in #598.The text was updated successfully, but these errors were encountered: