Specifies or queries the resource’s purgeable state.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
The desired purgeable state of a resource.
The prior purgeable state of the resource.
MTLPurgeable, the method returns the current purgeable state without changing it.
MTLPurgeable, the resource is marked to inform the caller that the data should not be discarded.
MTLPurgeable, the resource is marked as data that can be discarded, because the caller no longer needs the contents of the resource.
MTLPurgeable, the resource is marked as data that can be discarded, even if the caller may need the resource.
MTLResource objects can be made purgeable, even if the caller may need the resource, where the implementation can reclaim the underlying storage at any time without informing the app. Purgeable resources may enable an app to keep larger caches of idle memory that may be useful again in the future without the risk of preventing the allocation of more important memory.
When you use purgeable memory, make sure the block of memory is locked before you access it. This locking mechanism is necessary to ensure that auto-removal policies do not discard the data while you are accessing it. Similarly, the locking mechanism ensures that the virtual memory system has not already discarded the data.