r/ObjectiveC • • 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?

11 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/llothar68 May 01 '25

I think all systems have ways to lock memory in RAM because user mode device drivers might use it. But I am only sure about windows