Open
Description
The problem is that such memory must always be freed with FreeHGlobal but it's difficult for the user to always do so. Conversion operators are an example. Instead of AllocHGlobal, we could use a regular managed C# field of type the internal structure. There are problems such as this field being allocated as soon as declared since it's a struct, which is inefficient, but it needs to be at least considered.