---
title: alignment
framework: swift
role: symbol
role_heading: Type Property
path: swift/memorylayout/alignment
---

# alignment

The default memory alignment of T, in bytes.

## Declaration

```swift
static var alignment: Int { get }
```

## Discussion

Discussion Use the alignment property for a type when allocating memory using an unsafe pointer. This value is always positive.

## See Also

### Accessing the Layout of a Type

- [size](swift/memorylayout/size.md)
- [stride](swift/memorylayout/stride.md)
