---
title: ensureCapacity
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osarray/ensurecapacity
---

# ensureCapacity

Allocates capacity for members in array.

## Declaration

```occ
virtual uint32_t ensureCapacity(uint32_t newCapacity);
```

## Parameters

- `newCapacity`: Count of allocated capacity for members in array.

## Return Value

Return Value New count of capacity for members in array, may return prior capacity on failure.

## See Also

### Inspecting an Array

- [getCount](driverkit/osarray/getcount.md)
- [getCapacity](driverkit/osarray/getcapacity.md)
- [OSArrayGetCount](driverkit/osarraygetcount.md)
