---
title: withCapacity
framework: kernel
role: pseudoSymbol
path: kernel/iointerleavedmemorydescriptor/1812626-withcapacity
---

# withCapacity

Create an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors.

## Declaration

```occ
static IOInterleavedMemoryDescriptor * withCapacity(
 IOByteCountcapacity, 
 IODirectiondirection); 
```

## Parameters

- `capacity`: The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor.
- `direction`: An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures.

## Return Value

Return Value The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure.

## Overview

Overview This method creates and initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer.

## See Also

### Miscellaneous

- [clearMemoryDescriptors](kernel/iointerleavedmemorydescriptor/1812566-clearmemorydescriptors.md)
- [complete](kernel/iointerleavedmemorydescriptor/1812579-complete.md)
- [getPhysicalSegment](kernel/iointerleavedmemorydescriptor/1812587-getphysicalsegment.md)
- [initWithCapacity](kernel/iointerleavedmemorydescriptor/1812598-initwithcapacity.md)
- [prepare](kernel/iointerleavedmemorydescriptor/1812608-prepare.md)
- [setMemoryDescriptor](kernel/iointerleavedmemorydescriptor/1812618-setmemorydescriptor.md)
