---
title: getCapacity
framework: Kernel
role: symbol
role_heading: Instance Method
platforms: [driverkit 19.0+, macOS 10.15+]
path: kernel/osdata/3180880-getcapacity
---

# getCapacity

Returns length of preallocated capacity.

## Declaration

```occ
size_t getCapacity(void);
```

```occ
virtual unsigned int getCapacity(void);
```

## Return Value

Return Value length of preallocated capacity.

## See Also

### Inspecting a Data Object

- [getLength](kernel/osdata/3180881-getlength.md)
