-
- All Known Implementing Classes:
VulkanLWJGLTemporaryAllocator
public interface VulkanTemporaryAllocatorType
An allocator for temporary, aligned memory. The API is designed such that it should be very difficult, short of deliberate sabotage, to leak memory or use memory after it has been freed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E extends java.lang.Exception>
A receiver of allocated memory.static interface
VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E extends java.lang.Exception>
A receiver of allocated memory.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T,E extends java.lang.Exception>
TwithAllocation(long size, long alignment, VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E> receiver)
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.<T,E extends java.lang.Exception>
TwithAllocationBuffer(long size, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver)
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.<T,E extends java.lang.Exception>
TwithAllocationBufferInitialized(byte[] data, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver)
Allocatedata.length
octets of memory, aligned toalignment
, initialize it with the contents ofdata
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.
-
-
-
Method Detail
-
withAllocation
<T,E extends java.lang.Exception> T withAllocation(long size, long alignment, VulkanTemporaryAllocatorType.RawMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
size
- The size of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
withAllocationBuffer
<T,E extends java.lang.Exception> T withAllocationBuffer(long size, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Allocatesize
octets of memory, aligned toalignment
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
size
- The size of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
withAllocationBufferInitialized
<T,E extends java.lang.Exception> T withAllocationBufferInitialized(byte[] data, long alignment, VulkanTemporaryAllocatorType.ByteBufferMemoryReceiverType<T,E> receiver) throws VulkanException, E extends java.lang.Exception
Allocatedata.length
octets of memory, aligned toalignment
, initialize it with the contents ofdata
, pass it toreceiver
, then unconditionally deallocate the memory before returning the value ofT
returned byreceiver
.- Type Parameters:
T
- The type of returned valuesE
- The type of raised exceptions- Parameters:
data
- The initial contents of the memoryalignment
- The alignment of the memoryreceiver
- The receiver of the allocated memory- Returns:
- The value returned by
receiver
- Throws:
VulkanException
- Ifreceiver
raisesVulkanException
E
- Ifreceiver
raisesE
E extends java.lang.Exception
-
-