Esempio n. 1
0
        static IntPtr Allocation(IntPtr pUserData, IntPtr size, IntPtr alignment, VkSystemAllocationScope allocationScope)
        {
            IntPtr result = System.Runtime.InteropServices.Marshal.AllocHGlobal(size);

            if (result.ToInt64() % alignment.ToInt64() != 0)
            {
                throw new Exception("Fatal allocation error");
            }
            return(result);
        }
Esempio n. 2
0
 static IntPtr Reallocation(IntPtr pUserData, IntPtr pOriginal, IntPtr size, IntPtr alignment, VkSystemAllocationScope allocationScope)
 {
     return(System.Runtime.InteropServices.Marshal.ReAllocHGlobal(pOriginal, size));
 }