---
title: getCapacity
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osdata/getcapacity
---

# getCapacity

Returns length of preallocated capacity.

## Declaration

```occ
size_t getCapacity() const;
```

## Return Value

Return Value Length of preallocated capacity.

## See Also

### Inspecting a Data Object

- [getLength](driverkit/osdata/getlength.md)
- [OSDataGetLength](driverkit/osdatagetlength.md)
