Class VMAHeapBudget
java.lang.Object
com.io7m.jcoronado.vma.VMAHeapBudget
- All Implemented Interfaces:
VMAHeapBudgetType
The current memory usage and recommended budget for a single memory heap.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionlongbudget()static VMAHeapBudget.Builderbuilder()Creates a builder forVMAHeapBudget.static VMAHeapBudgetcopyOf(VMAHeapBudgetType instance) Creates an immutable copy of aVMAHeapBudgetTypevalue.booleanThis instance is equal to all instances ofVMAHeapBudgetthat have equal attribute values.inthashCode()Computes a hash code from attributes:usage,budget.toString()Prints the immutable valueVMAHeapBudgetwith attribute values.longusage()final VMAHeapBudgetwithBudget(long value) Copy the current immutable object by setting a value for thebudgetattribute.final VMAHeapBudgetwithUsage(long value) Copy the current immutable object by setting a value for theusageattribute.
-
Method Details
-
usage
public long usage()- Specified by:
usagein interfaceVMAHeapBudgetType- Returns:
- The current memory usage of the heap, in bytes.
-
budget
public long budget()- Specified by:
budgetin interfaceVMAHeapBudgetType- Returns:
- The recommended memory budget for the heap, in bytes. Keeping usage at or below the budget avoids the driver stalling or returning VK_ERROR_OUT_OF_DEVICE_MEMORY.
-
withUsage
Copy the current immutable object by setting a value for theusageattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for usage- Returns:
- A modified copy or the
thisobject
-
withBudget
Copy the current immutable object by setting a value for thebudgetattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for budget- Returns:
- A modified copy or the
thisobject
-
equals
-
hashCode
-
toString
-
copyOf
Creates an immutable copy of aVMAHeapBudgetTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable VMAHeapBudget instance
-
builder
Creates a builder forVMAHeapBudget.VMAHeapBudget.builder() .setUsage(long) // required
usage.setBudget(long) // requiredbudget.build();- Returns:
- A new VMAHeapBudget builder
-