All pastes #937121 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-10 21:24 UTC
rendered paste body
#include <stdlib.h>
#include <stdio.h>

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