AllocOptions

Structure controlling an allocation of memory

Members

Functions

withFlags
AllocOptions withFlags(AllocFlags flags)

set flags to options

withPreferredProps
AllocOptions withPreferredProps(MemProps props)

set preferredProps to options

withRequiredBits
AllocOptions withRequiredBits(MemProps props)

set requiredProps to options

withTypeIndexMask
AllocOptions withTypeIndexMask(uint indexMask)

set type index mask to options

Properties

forUsage
MemoryUsage forUsage [@property setter]

Initializes an AllocOptions with usage

Variables

flags
AllocFlags flags;

Control flags

memTypeIndexMask
uint memTypeIndexMask;

mask of memory type indices (0b0101 means indices 0 and 2) that, if not zero, will constrain MemoryRequirement.memTypeMask

preferredProps
MemProps preferredProps;

MemProps 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
MemProps requiredProps;

MemProps bits that must be set. Allocation will fail if it can't allocate a memory type satisfies all bits.

usage
MemoryUsage usage;

Intended usage. Will affect preferredBits and requiredBits;

Meta