Record Class VmaDefragmentationMove

java.lang.Object
java.lang.Record
club.doki7.vma.datatype.VmaDefragmentationMove
All Implemented Interfaces:
IPointer, IVmaDefragmentationMove

@ValueBasedCandidate @UnsafeConstructor public record VmaDefragmentationMove(@NotNull MemorySegment segment) extends Record implements IVmaDefragmentationMove

Single move of an allocation to be done for defragmentation.

Structure

typedef struct VmaDefragmentationMove {
    VmaDefragmentationMoveOperation operation;
    VmaAllocation srcAllocation;
    VmaAllocation dstTmpAllocation;
} VmaDefragmentationMove;

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

  • operation() Operation to be performed on the allocation by vmaEndDefragmentationPass(). Default value is VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it.
  • srcAllocation() Allocation that should be moved.
  • dstTmpAllocation() Temporary allocation pointing to destination memory that will replace `srcAllocation`.

    Warning: Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass, to be used for binding new buffer/image to the destination memory using e.g. vmaBindBufferMemory(). vmaEndDefragmentationPass() will destroy it and make srcAllocation point to this memory.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$operation

      public static final MemoryLayout.PathElement PATH$operation
    • PATH$srcAllocation

      public static final MemoryLayout.PathElement PATH$srcAllocation
    • PATH$dstTmpAllocation

      public static final MemoryLayout.PathElement PATH$dstTmpAllocation
    • LAYOUT$operation

      public static final ValueLayout.OfInt LAYOUT$operation
    • LAYOUT$srcAllocation

      public static final AddressLayout LAYOUT$srcAllocation
    • LAYOUT$dstTmpAllocation

      public static final AddressLayout LAYOUT$dstTmpAllocation
    • SIZE$operation

      public static final long SIZE$operation
    • SIZE$srcAllocation

      public static final long SIZE$srcAllocation
    • SIZE$dstTmpAllocation

      public static final long SIZE$dstTmpAllocation
    • OFFSET$operation

      public static final long OFFSET$operation
    • OFFSET$srcAllocation

      public static final long OFFSET$srcAllocation
    • OFFSET$dstTmpAllocation

      public static final long OFFSET$dstTmpAllocation
  • Constructor Details

    • VmaDefragmentationMove

      public VmaDefragmentationMove(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a VmaDefragmentationMove record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details