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

# IODelete

Frees the memory associated with a valid, typed array.

```
#define IODelete(ptr, type, count)
```

## Parameters

`ptr`

The pointer to the memory block to free. This pointer must not be `NULL`.

`type`

The data type stored in the memory block. The macro uses the type to determine its size.

`count`

The number of array entries in the memory block

## Discussion

Use this macro to free memory that you allocated with [`IONew`](/documentation/DriverKit/IONew) or [`IONewZero`](/documentation/DriverKit/IONewZero). It is a programmer error to pass a `NULL` pointer to this macro.

---

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)