#include #include int main(int argc, char **argv) { unsigned long lump = 2L * 1024L * 1024L * 1024L + 1L; unsigned char *thereabouts = (unsigned char *)malloc(lump); thereabouts[lump - 1L] = 'a'; printf("0x%x (%u) bytes starting at %p\n", lump, lump, thereabouts); return 0; } $ ./more_than_2_gig 0x80000001 (2147483649) bytes starting at 0x2aaaaaab8010