by worthless-trash · 1y ago · 0 comments
I not think you can deal with the failure condition the way you think on Linux (and I imagine other operating systems too).
% ulimit -v 80000
% cat test.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char *p = malloc(100'000'000);
printf("%p\n", p);
}
% cc test.c
% ./a.out
(nil)