// utility functions usable by wrappers around actual functions calling into the C++ core public static IntPtr Alloc(Type T) { IntPtr mem = Marshal.AllocHGlobal(CustomMarshal.SizeOf(T)); FillMemory(mem, CustomMarshal.SizeOf(T), 0); return(mem); }
public static IntPtr Alloc(Type T, int arraylen) { IntPtr mem = Marshal.AllocHGlobal(CustomMarshal.SizeOf(T) * arraylen); FillMemory(mem, CustomMarshal.SizeOf(T) * arraylen, 0); return(mem); }