---
title: scratchBufferAllocator
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtliocommandqueuedescriptor/scratchbufferallocator
---

# scratchBufferAllocator

An optional memory allocator that you implement to manage the scratch memory that an input/output command queue requests.

## Declaration

```swift
var scratchBufferAllocator: (any MTLIOScratchBufferAllocator)? { get set }
```

## Discussion

Discussion Your app can manage an input/output command queue’s scratch memory by an implementing MTLIOScratchBufferAllocator in one of your types, and assigning an instance of it to scratchBufferAllocator. Otherwise, set to nil to instruct the input/output command queue to allocate and manage its own scratch buffers. note: An input/output command queue uses scratch buffers for memory-intensives tasks, including loading textures and decompressing asset files.
