---
title: "IOSurfaceGetAllocSize(_:)"
framework: iosurface
role: symbol
role_heading: Function
path: "iosurface/iosurfacegetallocsize(_:)"
---

# IOSurfaceGetAllocSize(_:)

Returns the total allocation size of the buffer including all planes.

## Declaration

```swift
func IOSurfaceGetAllocSize(_ buffer: IOSurfaceRef) -> Int
```

## Return Value

Return Value Returns 0 if buffer is invalid.

## See Also

### Functions

- [IOSurfaceAlignProperty(_:_:)](iosurface/iosurfacealignproperty(_:_:).md)
- [IOSurfaceAllowsPixelSizeCasting(_:)](iosurface/iosurfaceallowspixelsizecasting(_:).md)
- [IOSurfaceCopyAllValues(_:)](iosurface/iosurfacecopyallvalues(_:).md)
- [IOSurfaceCopyValue(_:_:)](iosurface/iosurfacecopyvalue(_:_:).md)
- [IOSurfaceCreate(_:)](iosurface/iosurfacecreate(_:).md)
- [IOSurfaceCreateMachPort(_:)](iosurface/iosurfacecreatemachport(_:).md)
- [IOSurfaceCreateXPCObject(_:)](iosurface/iosurfacecreatexpcobject(_:).md)
- [IOSurfaceDecrementUseCount(_:)](iosurface/iosurfacedecrementusecount(_:).md)
- [IOSurfaceGetBaseAddress(_:)](iosurface/iosurfacegetbaseaddress(_:).md)
- [IOSurfaceGetBaseAddressOfPlane(_:_:)](iosurface/iosurfacegetbaseaddressofplane(_:_:).md)
- [IOSurfaceGetBitDepthOfComponentOfPlane(_:_:_:)](iosurface/iosurfacegetbitdepthofcomponentofplane(_:_:_:).md)
- [IOSurfaceGetBitOffsetOfComponentOfPlane(_:_:_:)](iosurface/iosurfacegetbitoffsetofcomponentofplane(_:_:_:).md)
- [IOSurfaceGetBytesPerElement(_:)](iosurface/iosurfacegetbytesperelement(_:).md)
- [IOSurfaceGetBytesPerElementOfPlane(_:_:)](iosurface/iosurfacegetbytesperelementofplane(_:_:).md)
- [IOSurfaceGetBytesPerRow(_:)](iosurface/iosurfacegetbytesperrow(_:).md)
