<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnsafeRawPointer/alignedUp(toMultipleOf:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SV9alignedUp12toMultipleOfSVSi_tF"
  },
  "title" : "alignedUp(toMultipleOf:)"
}
-->

# alignedUp(toMultipleOf:)

Obtain the next pointer whose bit pattern is a multiple of `alignment`.

```
func alignedUp(toMultipleOf alignment: Int) -> UnsafeRawPointer
```

## Parameters

`alignment`

the alignment of the returned pointer, in bytes.
`alignment` must be a whole power of 2.

## Return Value

a pointer aligned to `alignment`.

## Discussion

If the bit pattern of `self` is a multiple of `alignment`,
this function returns `self`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)