---
title: heapOffset
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlresource/heapoffset
---

# heapOffset

The distance, in bytes, from the beginning of the heap to the first byte of the resource, if you allocated the resource on a heap.

## Declaration

```swift
var heapOffset: Int { get }
```

## Discussion

Discussion If the heap is not a placement heap (MTLHeapType.placement), the value is always 0 and should be ignored.

## See Also

### Managing heap resources

- [heap](metal/mtlresource/heap.md)
- [makeAliasable()](metal/mtlresource/makealiasable().md)
- [isAliasable()](metal/mtlresource/isaliasable().md)
