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 of VmaDefragmentationFlagBits.
  • 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.
  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$flags

      public static final MemoryLayout.PathElement PATH$flags
    • PATH$pool

      public static final MemoryLayout.PathElement PATH$pool
    • PATH$maxBytesPerPass

      public static final MemoryLayout.PathElement PATH$maxBytesPerPass
    • PATH$maxAllocationsPerPass

      public static final MemoryLayout.PathElement PATH$maxAllocationsPerPass
    • PATH$pfnBreakCallback

      public static final MemoryLayout.PathElement PATH$pfnBreakCallback
    • PATH$pBreakCallbackUserData

      public static final MemoryLayout.PathElement PATH$pBreakCallbackUserData
    • LAYOUT$flags

      public static final ValueLayout.OfInt LAYOUT$flags
    • LAYOUT$pool

      public static final AddressLayout LAYOUT$pool
    • LAYOUT$maxBytesPerPass

      public static final ValueLayout.OfLong LAYOUT$maxBytesPerPass
    • LAYOUT$maxAllocationsPerPass

      public static final ValueLayout.OfInt LAYOUT$maxAllocationsPerPass
    • LAYOUT$pfnBreakCallback

      public static final AddressLayout LAYOUT$pfnBreakCallback
    • LAYOUT$pBreakCallbackUserData

      public static final AddressLayout 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

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