---
title: "object_getIndexedIvars(_:)"
framework: objectivec
role: symbol
role_heading: Function
path: "objectivec/object_getindexedivars(_:)"
---

# object_getIndexedIvars(_:)

Returns a pointer to any extra bytes allocated with a instance given object.

## Declaration

```swift
func object_getIndexedIvars(_ obj: Any?) -> UnsafeMutableRawPointer?
```

## Parameters

- `obj`: An Objective-C object.

## Return Value

Return Value A pointer to any extra bytes allocated with obj. If obj was not allocated with any extra bytes, then dereferencing the returned pointer is undefined.

## Discussion

Discussion This function returns a pointer to any extra bytes allocated with the instance (as specified by class_createInstance(_:_:) with extraBytes>0). This memory follows the object’s ordinary ivars, but may not be adjacent to the last ivar. The returned pointer is guaranteed to be pointer-size aligned, even if the area following the object’s last ivar is less aligned than that. Alignment greater than pointer-size is never guaranteed, even if the area following the object’s last ivar is more aligned than that. In a garbage-collected environment, the memory is scanned conservatively.

## See Also

### Working with Instances

- [object_getIvar(_:_:)](objectivec/object_getivar(_:_:).md)
- [object_setIvar(_:_:_:)](objectivec/object_setivar(_:_:_:).md)
- [object_getClassName(_:)](objectivec/object_getclassname(_:).md)
- [object_getClass(_:)](objectivec/object_getclass(_:).md)
- [object_setClass(_:_:)](objectivec/object_setclass(_:_:).md)
