public static void *malloc(long size) { var ptr = Marshal.AllocHGlobal((int)size); MemoryStats.Allocated(); return(ptr.ToPointer()); }
public static void free(void *a) { if (a == null) { return; } var ptr = new IntPtr(a); Marshal.FreeHGlobal(ptr); MemoryStats.Freed(); }