Record Class VmaDefragmentationInfo
java.lang.Object
java.lang.Record
club.doki7.vma.datatype.VmaDefragmentationInfo
- All Implemented Interfaces:
IPointer
,IVmaDefragmentationInfo
@ValueBasedCandidate
@UnsafeConstructor
public record VmaDefragmentationInfo(@NotNull MemorySegment segment)
extends Record
implements IVmaDefragmentationInfo
Parameters for defragmentation.
To be used with function vmaBeginDefragmentation().
Structure
typedef struct VmaDefragmentationInfo {
VmaDefragmentationFlags
flags
;
VmaPool
pool
; // optional
VkDeviceSize maxBytesPerPass
;
uint32_t maxAllocationsPerPass
;
PFN_vmaCheckDefragmentationBreakFunction pfnBreakCallback
; // optional
void* pBreakCallbackUserData
; // optional
} VmaDefragmentationInfo;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
Member documentation
flags()
Use combination ofVmaDefragmentationFlagBits
.pool()
Custom pool to be defragmented.If null then default pools will undergo defragmentation process.
maxBytesPerPass()
Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places.0
means no limit.maxAllocationsPerPass()
Maximum number of allocations that can be moved during single pass to a different place.0
means no limit.pfnBreakCallback()
Optional custom callback for stopping vmaBeginDefragmentation().Have to return true for breaking current defragmentation pass.
pBreakCallbackUserData()
Optional data to pass to custom callback for stopping pass of defragmentation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfLong
static final AddressLayout
static final AddressLayout
static final AddressLayout
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaDefragmentationInfo
(@NotNull MemorySegment segment) Creates an instance of aVmaDefragmentationInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaDefragmentationInfo
static VmaDefragmentationInfo.Ptr
static VmaDefragmentationInfo
clone
(Arena arena, VmaDefragmentationInfo src) final boolean
Indicates whether some other object is "equal to" this one.int
flags()
flags
(int value) final int
hashCode()
Returns a hash code value for this object.int
maxAllocationsPerPass
(int value) long
maxBytesPerPass
(long value) pBreakCallbackUserData
(@Nullable IPointer pointer) void
pfnBreakCallback
(@Nullable IPointer pointer) void
pfnBreakCallback
(MemorySegment value) @Nullable VmaPool
pool()
@NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$flags
-
PATH$pool
-
PATH$maxBytesPerPass
-
PATH$maxAllocationsPerPass
-
PATH$pfnBreakCallback
-
PATH$pBreakCallbackUserData
-
LAYOUT$flags
-
LAYOUT$pool
-
LAYOUT$maxBytesPerPass
-
LAYOUT$maxAllocationsPerPass
-
LAYOUT$pfnBreakCallback
-
LAYOUT$pBreakCallbackUserData
-
SIZE$flags
public static final long SIZE$flags -
SIZE$pool
public static final long SIZE$pool -
SIZE$maxBytesPerPass
public static final long SIZE$maxBytesPerPass -
SIZE$maxAllocationsPerPass
public static final long SIZE$maxAllocationsPerPass -
SIZE$pfnBreakCallback
public static final long SIZE$pfnBreakCallback -
SIZE$pBreakCallbackUserData
public static final long SIZE$pBreakCallbackUserData -
OFFSET$flags
public static final long OFFSET$flags -
OFFSET$pool
public static final long OFFSET$pool -
OFFSET$maxBytesPerPass
public static final long OFFSET$maxBytesPerPass -
OFFSET$maxAllocationsPerPass
public static final long OFFSET$maxAllocationsPerPass -
OFFSET$pfnBreakCallback
public static final long OFFSET$pfnBreakCallback -
OFFSET$pBreakCallbackUserData
public static final long OFFSET$pBreakCallbackUserData
-
-
Constructor Details
-
VmaDefragmentationInfo
Creates an instance of aVmaDefragmentationInfo
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
flags
-
flags
-
pool
-
pool
-
maxBytesPerPass
-
maxBytesPerPass
-
maxAllocationsPerPass
-
maxAllocationsPerPass
-
pfnBreakCallback
@Pointer(comment="PFN_vmaCheckDefragmentationBreakFunction") public MemorySegment pfnBreakCallback() -
pfnBreakCallback
public void pfnBreakCallback(@Pointer(comment="PFN_vmaCheckDefragmentationBreakFunction") MemorySegment value) -
pfnBreakCallback
-
pBreakCallbackUserData
-
pBreakCallbackUserData
-
pBreakCallbackUserData
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-