コード例 #1
0
        // 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);
        }
コード例 #2
0
ファイル: CustomMarshaling.cs プロジェクト: wolf96/renderdoc
        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);
        }