---
title: NSAllocateCollectable
framework: foundation
role: symbol
role_heading: Function
path: foundation/nsallocatecollectable
---

# NSAllocateCollectable

Allocates collectable memory.

## Declaration

```occ
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

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

## See Also

### Legacy

- [NSGarbageCollector](foundation/nsgarbagecollector.md)
- [NSReallocateCollectable](foundation/nsreallocatecollectable.md)
- [NSMakeCollectable](foundation/nsmakecollectable.md)
- [Memory Allocation Options](foundation/1539826-memory-allocation-options.md)
