Struct AllocOptions

Structure controlling an allocation of memory

struct AllocOptions ;

Fields

NameTypeDescription
flags AllocFlagsControl flags
memTypeIndexMask uintmask of memory type indices (0b0101 means indices 0 and 2) that, if not zero, will constrain MemoryRequirement.memTypeMask
preferredProps MemPropsMemProps bits that are optional but are preferred to be present. Allocation will favor memory types with these bits if available, but may fallback to other memory types.
requiredProps MemPropsMemProps bits that must be set. Allocation will fail if it can't allocate a memory type satisfies all bits.
usage MemoryUsageIntended usage. Will affect preferredBits and requiredBits;

Properties

NameTypeDescription
forUsage[set] AllocOptionsInitializes an AllocOptions with usage

Methods

NameDescription
withFlags (flags) set flags to options
withPreferredProps (props) set preferredProps to options
withRequiredBits (props) set requiredProps to options
withTypeIndexMask (indexMask) set type index mask to options