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

# addAllocation(_:)

Stages a single resource to join the residency set’s list of allocations.

## Declaration

```swift
func addAllocation(_ allocation: any MTLAllocation)
```

## Parameters

- `allocation`: 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.

## Mentioned in

Simplifying GPU resource management with residency sets

## Discussion

Discussion Finalize the inclusion of these resource allocations, and all other changes you stage, by calling a residency set’s commit() method.

## See Also

### Adding allocations

- [addAllocations(_:)](metal/mtlresidencyset/addallocations(_:).md)
