pub struct HeapDescriptor(/* private fields */);Expand description
A configuration for a heap.
C++ equivalent: MTL::HeapDescriptor
Implementations§
Source§impl HeapDescriptor
impl HeapDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new heap descriptor.
C++ equivalent: static HeapDescriptor* alloc()->init()
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Create a HeapDescriptor from a raw pointer.
§Safety
The pointer must be a valid Metal heap descriptor object.
Sourcepub fn set_size(&self, size: UInteger)
pub fn set_size(&self, size: UInteger)
Set the heap size.
C++ equivalent: void setSize(NS::UInteger)
Sourcepub fn storage_mode(&self) -> StorageMode
pub fn storage_mode(&self) -> StorageMode
Get the storage mode.
C++ equivalent: StorageMode storageMode() const
Sourcepub fn set_storage_mode(&self, mode: StorageMode)
pub fn set_storage_mode(&self, mode: StorageMode)
Set the storage mode.
C++ equivalent: void setStorageMode(StorageMode)
Sourcepub fn cpu_cache_mode(&self) -> CPUCacheMode
pub fn cpu_cache_mode(&self) -> CPUCacheMode
Get the CPU cache mode.
C++ equivalent: CPUCacheMode cpuCacheMode() const
Sourcepub fn set_cpu_cache_mode(&self, mode: CPUCacheMode)
pub fn set_cpu_cache_mode(&self, mode: CPUCacheMode)
Set the CPU cache mode.
C++ equivalent: void setCpuCacheMode(CPUCacheMode)
Sourcepub fn hazard_tracking_mode(&self) -> HazardTrackingMode
pub fn hazard_tracking_mode(&self) -> HazardTrackingMode
Get the hazard tracking mode.
C++ equivalent: HazardTrackingMode hazardTrackingMode() const
Sourcepub fn set_hazard_tracking_mode(&self, mode: HazardTrackingMode)
pub fn set_hazard_tracking_mode(&self, mode: HazardTrackingMode)
Set the hazard tracking mode.
C++ equivalent: void setHazardTrackingMode(HazardTrackingMode)
Sourcepub fn resource_options(&self) -> ResourceOptions
pub fn resource_options(&self) -> ResourceOptions
Get the resource options.
C++ equivalent: ResourceOptions resourceOptions() const
Sourcepub fn set_resource_options(&self, options: ResourceOptions)
pub fn set_resource_options(&self, options: ResourceOptions)
Set the resource options.
C++ equivalent: void setResourceOptions(ResourceOptions)
Sourcepub fn set_heap_type(&self, heap_type: HeapType)
pub fn set_heap_type(&self, heap_type: HeapType)
Set the heap type.
C++ equivalent: void setType(HeapType)
Sourcepub fn sparse_page_size(&self) -> SparsePageSize
pub fn sparse_page_size(&self) -> SparsePageSize
Get the sparse page size.
C++ equivalent: SparsePageSize sparsePageSize() const
Sourcepub fn set_sparse_page_size(&self, size: SparsePageSize)
pub fn set_sparse_page_size(&self, size: SparsePageSize)
Set the sparse page size.
C++ equivalent: void setSparsePageSize(SparsePageSize)
Sourcepub fn max_compatible_placement_sparse_page_size(&self) -> SparsePageSize
pub fn max_compatible_placement_sparse_page_size(&self) -> SparsePageSize
Get the maximum compatible placement sparse page size.
C++ equivalent: SparsePageSize maxCompatiblePlacementSparsePageSize() const
Sourcepub fn set_max_compatible_placement_sparse_page_size(
&self,
size: SparsePageSize,
)
pub fn set_max_compatible_placement_sparse_page_size( &self, size: SparsePageSize, )
Set the maximum compatible placement sparse page size.
C++ equivalent: void setMaxCompatiblePlacementSparsePageSize(SparsePageSize)