Код: Выделить всё
byte* ptr1 = (byte*)NativeMemory.Alloc((nuint)4);
// let's say the bytes are 0xff 0xff 0x00 0x00
byte* ptr2 = ptr1 + 1;
NativeMemory.Copy(ptr1, ptr2, (nuint)3);
// will bytes now be 0xff 0xff 0xff 0x00 (safe)?
// or undefined?
Подробнее здесь: https://stackoverflow.com/questions/798 ... -of-memory
Мобильная версия