Esempio n. 1
0
 public Allocator(AllocFunction alloc, ReAllocFunction reAlloc, FreeFunction free)
 {
     m_alloc    = alloc;
     m_reAlloc  = reAlloc;
     m_free     = free;
     m_pointers = new List <Pointer <byte> >();
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AllocationCallbacks"/> structure.
 /// </summary>
 /// <param name="alloc">The application-defined memory allocation function.</param>
 /// <param name="realloc">The application-defined memory reallocation function.</param>
 /// <param name="free">The application-defined memory free function</param>
 /// <param name="internalAlloc">
 /// The application-defined function that is called by the implementation when the
 /// implementation makes internal allocations.
 /// </param>
 /// <param name="internalFree">
 /// The application-defined function that is called by the implementation when the
 /// implementation frees internal allocations.
 /// </param>
 /// <param name="userData">
 /// The value to be interpreted by the implementation of the callbacks.
 /// <para>
 /// When any of the callbacks in <see cref="AllocationCallbacks"/> are called, the Vulkan
 /// implementation will pass this value as the first parameter to the callback.
 /// </para>
 /// <para>
 /// This value can vary each time an allocator is passed into a command, even when the same
 /// object takes an allocator in multiple commands.
 /// </para>
 /// </param>
 public AllocationCallbacks(AllocationFunction alloc, ReallocationFunction realloc, FreeFunction free,
                            InternalAllocationNotification internalAlloc = null, InternalFreeNotification internalFree = null,
                            IntPtr userData = default(IntPtr))
 {
     Allocation         = alloc;
     Reallocation       = realloc;
     Free               = free;
     InternalAllocation = internalAlloc;
     InternalFree       = internalFree;
     UserData           = userData;
 }