---
title: GetLength
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/iomemorydescriptor/getlength
---

# GetLength

Returns the length of the memory block represented by this object.

## Declaration

```occ
kern_return_t GetLength(uint64_t *returnLength);
```

## Parameters

- `returnLength`: A variable in which to put the length of the current memory block.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion This method returns the effective size of the memory block, which might be less than the block’s total capacity.

## See Also

### Related Documentation

- [SetLength](driverkit/iobuffermemorydescriptor/setlength.md)
