Class VulkanLWJGLHostAllocatorJeMalloc
java.lang.Object
com.io7m.jcoronado.lwjgl.VulkanLWJGLHostAllocatorJeMalloc
- All Implemented Interfaces:
VulkanHostAllocatorCallbacksType.AllocationFunctionType, VulkanHostAllocatorCallbacksType.DeallocationFunctionType, VulkanHostAllocatorCallbacksType.InternalAllocationNotificationType, VulkanHostAllocatorCallbacksType.InternalFreeNotificationType, VulkanHostAllocatorCallbacksType.ReallocationFunctionType, VulkanHostAllocatorType
public final class VulkanLWJGLHostAllocatorJeMalloc
extends Object
implements VulkanHostAllocatorType
A JeMalloc based host allocator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongallocate(long size, long alignment, VulkanSystemAllocationScope scope) Allocatesizeoctets of memory, aligned toalignment, of scopescope.voiddeallocate(long address) Deallocate memory.voidonAllocation(long size, VulkanInternalAllocation type, VulkanSystemAllocationScope scope) Called upon internal allocations.voidonFree(long size, VulkanInternalAllocation type, VulkanSystemAllocationScope scope) Called upon internal deallocations.longreallocate(long address, long size, long alignment, VulkanSystemAllocationScope scope) Reallocatesizeoctets of memory, aligned toalignment, of scopescope.
-
Constructor Details
-
VulkanLWJGLHostAllocatorJeMalloc
public VulkanLWJGLHostAllocatorJeMalloc()Construct an allocator.
-
-
Method Details
-
allocate
Description copied from interface:VulkanHostAllocatorCallbacksType.AllocationFunctionTypeAllocatesizeoctets of memory, aligned toalignment, of scopescope. The function must return the address of the allocated memory as an integer, or0if the allocation has failed. The function MUST NOT raise exceptions under any circumstances.- Specified by:
allocatein interfaceVulkanHostAllocatorCallbacksType.AllocationFunctionType- Parameters:
size- The size of the allocationalignment- The alignment of the allocationscope- The scope of the allocation- Returns:
- The memory address
-
reallocate
Description copied from interface:VulkanHostAllocatorCallbacksType.ReallocationFunctionTypeReallocatesizeoctets of memory, aligned toalignment, of scopescope. The function must return the address of the allocated memory as an integer, or0if the allocation has failed. The function MUST NOT raise exceptions under any circumstances.- Specified by:
reallocatein interfaceVulkanHostAllocatorCallbacksType.ReallocationFunctionType- Parameters:
address- The original memory addresssize- The size of the allocationalignment- The alignment of the allocationscope- The scope of the allocation- Returns:
- The memory address
-
deallocate
public void deallocate(long address) Description copied from interface:VulkanHostAllocatorCallbacksType.DeallocationFunctionTypeDeallocate memory. The function MUST NOT raise exceptions under any circumstances.- Specified by:
deallocatein interfaceVulkanHostAllocatorCallbacksType.DeallocationFunctionType- Parameters:
address- The original memory address
-
onAllocation
public void onAllocation(long size, VulkanInternalAllocation type, VulkanSystemAllocationScope scope) Description copied from interface:VulkanHostAllocatorCallbacksType.InternalAllocationNotificationTypeCalled upon internal allocations. The function MUST NOT raise exceptions under any circumstances.- Specified by:
onAllocationin interfaceVulkanHostAllocatorCallbacksType.InternalAllocationNotificationType- Parameters:
size- The allocation size in bytestype- The type of allocationscope- The scope of the allocation
-
onFree
Description copied from interface:VulkanHostAllocatorCallbacksType.InternalFreeNotificationTypeCalled upon internal deallocations. The function MUST NOT raise exceptions under any circumstances.- Specified by:
onFreein interfaceVulkanHostAllocatorCallbacksType.InternalFreeNotificationType- Parameters:
size- The allocation size in bytestype- The type of allocationscope- The scope of the allocation
-
createCallbacks
- Specified by:
createCallbacksin interfaceVulkanHostAllocatorType- Returns:
- The methods as a set of callbacks
-