<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAllocateCollectable",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@F@NSAllocateCollectable"
  },
  "title" : "NSAllocateCollectable"
}
-->

# NSAllocateCollectable

Allocates collectable memory.

```
extern void *NSAllocateCollectable(NSUInteger size, NSUInteger options);
```

## Parameters

`size`

The number of bytes of memory to allocate.

`options`

`0` or `NSScannedOption`: A value of `0` allocates non-scanned memory; a value of `NSScannedOption` allocates scanned memory.

## Return Value

A pointer to the allocated memory, or `NULL` if the function is unable to allocate the requested memory.

---

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)