---
title: initWithDescriptors
framework: kernel
role: pseudoSymbol
path: kernel/iomultimemorydescriptor/1812635-initwithdescriptors
---

# initWithDescriptors

Initialize an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors.

## Declaration

```occ
virtual bool initWithDescriptors( 
 IOMemoryDescriptor **descriptors, 
 UInt32 withCount, 
 IODirection withDirection, 
 bool asReference = false ); 
```

## Parameters

- `descriptors`: An array of IOMemoryDescriptors which make up the memory to be described.
- `withCount`: The object count for the descriptors array.
- `withDirection`: An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures.
- `asReference`: If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation.

## Return Value

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

## Overview

Overview This method initializes an IOMultiMemoryDescriptor for memory consisting 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. Passing the descriptor array as a reference will avoid an extra allocation.

## See Also

### Miscellaneous

- [complete](kernel/iomultimemorydescriptor/1812588-complete.md)
- [getPhysicalSegment](kernel/iomultimemorydescriptor/1812610-getphysicalsegment.md)
- [prepare](kernel/iomultimemorydescriptor/1812660-prepare.md)
- [withDescriptors(IOMemoryDescriptor **, UInt32, IODirection, bool)](kernel/iomultimemorydescriptor/1812685-withdescriptors.md)
- [withDescriptors(IOMemoryDescriptor **, UInt32, IODirection, bool)](kernel/iomultimemorydescriptor/1812714-withdescriptors.md)
