Esempio n. 1
0
 public static void Destroy <T>(ref T value)
 {
     if (!Runtime.Info.IsStruct(value))
     {
         int            size = Unsafe.SizeOf(value, SizeOfOptions.Data);
         Pointer <byte> ptr  = Unsafe.AddressOfFields(ref value);
         ptr.ClearBytes(size);
     }
     else
     {
         value = default;
     }
 }