---
title: NSZoneRealloc
framework: foundation
role: symbol
role_heading: Function
path: foundation/nszonerealloc
---

# NSZoneRealloc

Allocates memory in a zone.

## Declaration

```occ
extern void *NSZoneRealloc(NSZone *zone, void *ptr, NSUInteger size);
```

## Discussion

Discussion Changes the size of the block of memory pointed to by ptr to size bytes. It may allocate new memory to replace the old, in which case it moves the contents of the old memory block to the new block, up to a maximum of size bytes. ptr may be NULL. This function returns NULL if it was unable to allocate the requested memory.

## See Also

### Managing Zones

- [NSCreateZone](foundation/nscreatezone.md)
- [NSRecycleZone](foundation/nsrecyclezone.md)
- [NSSetZoneName](foundation/nssetzonename.md)
- [NSZoneCalloc](foundation/nszonecalloc.md)
- [NSZoneFree](foundation/nszonefree.md)
- [NSZoneFromPointer](foundation/nszonefrompointer.md)
- [NSZoneMalloc](foundation/nszonemalloc.md)
- [NSZoneName](foundation/nszonename.md)
- [NSDefaultMallocZone](foundation/nsdefaultmalloczone.md)
