---
title: OSTypeAlloc
framework: driverkit
role: symbol
role_heading: Macro
path: driverkit/ostypealloc
---

# OSTypeAlloc

Allocates memory for a named class.

## Declaration

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

## Parameters

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

## Return Value

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

## Discussion

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 instead.

## See Also

### Allocation

- [IONew](driverkit/ionew.md)
- [IONewZero](driverkit/ionewzero.md)
- [IOMalloc](driverkit/iomalloc.md)
- [IOMallocZero](driverkit/iomalloczero.md)
