---
title: "withUnsafeMutableIndices(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelmesh/withunsafemutableindices(_:)"
---

# withUnsafeMutableIndices(_:)

Updates the index buffer synchronously on the CPU.

## Declaration

```swift
@MainActor func withUnsafeMutableIndices(_ callback: (UnsafeMutableRawBufferPointer) -> Void)
```

## Discussion

Discussion The buffer is only valid for the lifetime of the callback.

## See Also

### Accessing mesh data on the CPU with Swift

- [withUnsafeBytes(bufferIndex:_:)](realitykit/lowlevelmesh/withunsafebytes(bufferindex:_:).md)
- [withUnsafeMutableBytes(bufferIndex:_:)](realitykit/lowlevelmesh/withunsafemutablebytes(bufferindex:_:).md)
- [withUnsafeIndices(_:)](realitykit/lowlevelmesh/withunsafeindices(_:).md)
- [replaceUnsafeMutableBytes(bufferIndex:_:)](realitykit/lowlevelmesh/replaceunsafemutablebytes(bufferindex:_:).md)
- [replaceUnsafeMutableIndices(_:)](realitykit/lowlevelmesh/replaceunsafemutableindices(_:).md)
