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.0means no limit.maxAllocationsPerPass()Maximum number of allocations that can be moved during single pass to a different place.0means 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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfLongstatic final AddressLayoutstatic final AddressLayoutstatic final AddressLayoutstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionVmaDefragmentationInfo(@NotNull MemorySegment segment) Creates an instance of aVmaDefragmentationInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaDefragmentationInfostatic VmaDefragmentationInfo.Ptrstatic VmaDefragmentationInfoclone(Arena arena, VmaDefragmentationInfo src) final booleanIndicates whether some other object is "equal to" this one.intflags()flags(int value) final inthashCode()Returns a hash code value for this object.intmaxAllocationsPerPass(int value) longmaxBytesPerPass(long value) @NotNull MemorySegmentpBreakCallbackUserData(@Nullable IPointer pointer) pBreakCallbackUserData(@NotNull MemorySegment value) @NotNull MemorySegmentpfnBreakCallback(@Nullable IPointer pointer) pfnBreakCallback(@NotNull Arena arena, @NotNull VMAFunctionTypes.IPFN_vmaCheckDefragmentationBreakFunction value) pfnBreakCallback(@NotNull MemorySegment value) @Nullable VmaPoolpool()@NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()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 aVmaDefragmentationInforecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
flags
-
flags
-
pool
-
pool
-
maxBytesPerPass
-
maxBytesPerPass
-
maxAllocationsPerPass
-
maxAllocationsPerPass
-
pfnBreakCallback
@Pointer(comment="PFN_vmaCheckDefragmentationBreakFunction") @NotNull public @NotNull MemorySegment pfnBreakCallback() -
pfnBreakCallback
public VmaDefragmentationInfo pfnBreakCallback(@Pointer(comment="PFN_vmaCheckDefragmentationBreakFunction") @NotNull @NotNull MemorySegment value) -
pfnBreakCallback
public VmaDefragmentationInfo pfnBreakCallback(@NotNull @NotNull VMAFunctionTypes.IPFN_vmaCheckDefragmentationBreakFunction value) -
pfnBreakCallback
public VmaDefragmentationInfo pfnBreakCallback(@NotNull @NotNull Arena arena, @NotNull @NotNull VMAFunctionTypes.IPFN_vmaCheckDefragmentationBreakFunction value) -
pfnBreakCallback
-
pBreakCallbackUserData
-
pBreakCallbackUserData
public VmaDefragmentationInfo pBreakCallbackUserData(@Pointer(comment="void*") @NotNull @NotNull MemorySegment value) -
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 thesegmentrecord component.
-