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

# IOFree

Frees a memory block that contains general-purpose memory.

```
void IOFree(void *address, size_t length);
```

## Parameters

`address`

The pointer to the memory block to free. The memory block must be one that you previously allocated with [`IOMalloc`](/documentation/DriverKit/IOMalloc) or [`IOMallocZero`](/documentation/DriverKit/IOMallocZero).

`length`

The size of the memory block, which must match the block’s original allocation size.

## Discussion

Use this macro to free memory that you allocated with [`IOMalloc`](/documentation/DriverKit/IOMalloc) or [`IOMallocZero`](/documentation/DriverKit/IOMallocZero).

---

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)