---
title: "containsAllocation(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlresidencyset/containsallocation(_:)"
---

# containsAllocation(_:)

Returns a Boolean value that indicates whether the residency set contains a specific resource allocation.

## Declaration

```swift
func containsAllocation(_ anAllocation: any MTLAllocation) -> Bool
```

## Parameters

- `anAllocation`: A resource allocation, such as an doc://com.apple.metal/documentation/Metal/MTLBuffer, doc://com.apple.metal/documentation/Metal/MTLTexture, or doc://com.apple.metal/documentation/Metal/MTLHeap.

## See Also

### Inspecting a residency set

- [label](metal/mtlresidencyset/label.md)
- [device](metal/mtlresidencyset/device.md)
- [allAllocations](metal/mtlresidencyset/allallocations.md)
- [allocationCount](metal/mtlresidencyset/allocationcount.md)
- [allocatedSize](metal/mtlresidencyset/allocatedsize.md)
