<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/1539826-memory-allocation-options",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Memory Allocation Options"
}
-->

# Memory Allocation Options

Constants used to control behavior when allocating or reallocating collectible memory.

## Discussion

These constants are used as components in a bitfield to specify the behavior of [`NSAllocateCollectable`](/documentation/Foundation/NSAllocateCollectable) and [`NSReallocateCollectable`](/documentation/Foundation/NSReallocateCollectable).

## Topics

### Constants

[`NSScannedOption`](/documentation/Foundation/NSScannedOption)

Specifies allocation of scanned memory.

[`NSCollectorDisabledOption`](/documentation/Foundation/NSCollectorDisabledOption)

Specifies that the block is retained, and therefore ineligible for collection. Specifying this option is equivalent to invoking [`disableCollectorForPointer:`](/documentation/Foundation/NSGarbageCollector/disableCollectorForPointer:) with the returned block as the argument.



---

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)