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
#54006 introduced new NativeMemory APIs that wrap malloc, calloc, realloc, and aligned_alloc. We should audit existing usages of Marshal.AllocHGlobal for cases where it can be safely replaced with malloc.
Notably cases like StringToPtrHGlobal do not qualify as they are documented to be a call to LocalAlloc on Windows. However, on Unix and in cases where this is not a definitive contract, it should be safe to replace these calls with faster ones to NativeMemory.
The text was updated successfully, but these errors were encountered:
#54006 introduced new NativeMemory APIs that wrap
malloc
,calloc
,realloc
, andaligned_alloc
. We should audit existing usages ofMarshal.AllocHGlobal
for cases where it can be safely replaced withmalloc
.Notably cases like
StringToPtrHGlobal
do not qualify as they are documented to be a call toLocalAlloc
on Windows. However, on Unix and in cases where this is not a definitive contract, it should be safe to replace these calls with faster ones toNativeMemory
.The text was updated successfully, but these errors were encountered: