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

# OSTypeAlloc

Allocates memory for a named class.

```
#define OSTypeAlloc(type)
```

## Parameters

`type`

The name of the desired class as a raw token, not as a string or macro.

## Return Value

A pointer to the allocated memory block, or `NULL` on failure.

## Discussion

This is a general-purpose utility to allocate memory for DriverKit objects. Consider using object-specific creation methods instead. To allocate memory for use in I/O transfers, create an [`IOBufferMemoryDescriptor`](/documentation/DriverKit/IOBufferMemoryDescriptor) instead.

---

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)