<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOMemoryDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOMemoryDescriptor"
  },
  "title" : "IOMemoryDescriptor"
}
-->

# IOMemoryDescriptor

The base class for describing a location in memory.

```
class IOMemoryDescriptor;
```

## Overview

The [`IOMemoryDescriptor`](/documentation/DriverKit/IOMemoryDescriptor) class defines shared behavior for memory-related objects. Use the methods of this class to get information about a memory block and to map a memory block from another process into your driver’s memory space.

Don’t create instances of this class directly. When you want to allocate memory for your driver, create an [`IOBufferMemoryDescriptor`](/documentation/DriverKit/IOBufferMemoryDescriptor) instead, which is a concrete implementation of this class.

## Topics

### Configuring the Buffer

[`virtual bool init();`](/documentation/DriverKit/IOMemoryDescriptor/init)

Initializes the memory descriptor object.

[`virtual void free();`](/documentation/DriverKit/IOMemoryDescriptor/free)

Performs any final cleanup for the memory descriptor object.

### Getting the Buffer Length

[`kern_return_t GetLength(uint64_t *returnLength);`](/documentation/DriverKit/IOMemoryDescriptor/GetLength)

Returns the length of the memory block represented by this object.

### Mapping to the Caller’s Address Space

[`virtual kern_return_t CreateMapping(uint64_t options, uint64_t address, uint64_t offset, uint64_t length, uint64_t alignment, IOMemoryMap **map);`](/documentation/DriverKit/IOMemoryDescriptor/CreateMapping)

Maps the contents of the memory block to the address space of the current process.

[Memory Map Options](/documentation/DriverKit/3325558-memory_map_options)

Options that describe how to configure a memory-mapped buffer.

### Performing Internal Tasks

[`kern_return_t Map(uint64_t options, uint64_t address, uint64_t length, uint64_t alignment, uint64_t *returnAddress, uint64_t *returnLength);`](/documentation/DriverKit/IOMemoryDescriptor/Map)

Maps memory internally.

### Type Methods

[`static kern_return_t CreateSubMemoryDescriptor(uint64_t memoryDescriptorCreateOptions, uint64_t offset, uint64_t length, IOMemoryDescriptor *ofDescriptor, IOMemoryDescriptor **memory);`](/documentation/DriverKit/IOMemoryDescriptor/CreateSubMemoryDescriptor)

[`static kern_return_t CreateWithMemoryDescriptors(uint64_t memoryDescriptorCreateOptions, uint32_t withDescriptorsCount, IOMemoryDescriptor * const withDescriptors[32], IOMemoryDescriptor **memory);`](/documentation/DriverKit/IOMemoryDescriptor/CreateWithMemoryDescriptors)

## Relationships

### Inherited By

[`IOBufferMemoryDescriptor`](/documentation/DriverKit/IOBufferMemoryDescriptor)

### Inherits From

[`OSObject`](/documentation/DriverKit/OSObject)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)