r/ObjectiveC • u/BlockOfDiamond • Aug 25 '22
alloc method and insufficient memory
In C malloc can fail if there is not enough memory in the system. What happens if I try [NSObject alloc] while there is no memory available? Does it abort? Return NULL?
10
Upvotes
View all comments
Show parent comment
1
u/iOSCaleb Jun 01 '24
It’s not exactly a minor detail. And I don’t think I mentioned iOS. Any VM system works about the same way.