---
title: MTLIOScratchBuffer
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlioscratchbuffer
---

# MTLIOScratchBuffer

A protocol your app implements that wraps a Metal buffer instance to serve as scratch memory for an input/output command queue.

## Declaration

```swift
protocol MTLIOScratchBuffer : NSObjectProtocol
```

## Overview

Overview Your app can reintegrate an MTLIOScratchBuffer instance’s underlying memory back into a memory pool by overriding your type’s dealloc method. The system calls the method when an input/output command queue no longer needs a scratch buffer.

## Topics

### Wrapping a buffer

- [buffer](metal/mtlioscratchbuffer/buffer.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### I/O command queues

- [MTLIOCommandQueue](metal/mtliocommandqueue.md)
- [MTLIOCommandQueueDescriptor](metal/mtliocommandqueuedescriptor.md)
- [MTLIOPriority](metal/mtliopriority.md)
- [MTLIOCommandQueueType](metal/mtliocommandqueuetype.md)
- [MTLIOScratchBufferAllocator](metal/mtlioscratchbufferallocator.md)
