---
title: IOFree
framework: driverkit
role: symbol
role_heading: Function
path: driverkit/iofree
---

# IOFree

Frees a memory block that contains general-purpose memory.

## Declaration

```occ
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 doc://com.apple.driverkit/documentation/DriverKit/IOMalloc or doc://com.apple.driverkit/documentation/DriverKit/IOMallocZero.
- `length`: The size of the memory block, which must match the block’s original allocation size.

## Discussion

Discussion Use this macro to free memory that you allocated with IOMalloc or IOMallocZero.

## See Also

### Deallocation

- [IODelete](driverkit/iodelete.md)
- [IOSafeDeleteNULL](driverkit/iosafedeletenull.md)
- [OSSafeReleaseNULL](driverkit/ossafereleasenull.md)
