3 ms·
> Well, the difference is in possibility of checking the value returned by malloc() and thus being able to, for example, inform the user about the error Not o
by josefx 5y ago
> Well, the difference is in possibility of checking the value returned by malloc() and thus being able to, for example, inform the user about the error
Not on Linux. Memory over commit means that you get a pointer pointing to nowhere^1 . Your program will simply fail when it traverses the allocated address range the first time and the OS ends up unable to allocate enough memory pages to back the address range.
1 unless you exceed the total existing memory+swap space in a single allocation