<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/foundation-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Foundation Functions"
}
-->

# Foundation Functions

This document describes the functions and function-like macros defined in the Foundation Framework.

## Topics

### Debugging

[`extern NSUInteger NSCountFrames();`](/documentation/Foundation/NSCountFrames)

Returns the number of call frames on the stack.

[`extern void *NSFrameAddress(NSUInteger frame);`](/documentation/Foundation/NSFrameAddress)

Returns the value of the frame pointer of the specified frame.

[`extern BOOL NSIsFreedObject(id anObject);`](/documentation/Foundation/NSIsFreedObject)

Returns a Boolean indicating whether the specified object has been freed.

[`extern void NSRecordAllocationEvent(int eventType, id object);`](/documentation/Foundation/NSRecordAllocationEvent)

Notes an object or zone allocation event and various other statistics, such as the time and current thread.

[`extern void *NSReturnAddress(NSUInteger frame);`](/documentation/Foundation/NSReturnAddress)

Returns the value of the return address of the specified frame.



---

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)