4、行交互操作: byte[] buffer = new byte[100]; fixed (byte* p = buffer) { P[0] = 123; …… } 6. 其它7. 附1: public unsafe class Memory { // Handle for the process heap. Thi
5、s handle is used in all calls to the // HeapXXX APIs in the methods below. static int ph = GetProcessHeap(); // Private instance constructor to prevent instantiation. private Memory() { } // Allocates a memory block of the given size. The allocated me
6、mory is // automatically initialized to zero. public static void* Alloc(int size) { void* result = HeapAlloc(ph, HEAP_ZERO_MEMORY, size); if (result == null) throw new OutOfMemoryException(); return result; } 很多人将C#和Java进行