All pastes #1972062 Raw Edit

malloc.c

public c v1 · immutable
#1972062 ·published 2010-10-24 18:09 UTC
rendered paste body
#include <stdio.h>#include <assert.h>int main(int argc, char *argv[]){    int i;    int malloc_size = 0x1 << 28;    int call_time = 1;    void *p;    char dummy;    for(i=0; i<call_time; i++)    {      p = malloc(malloc_size);      assert(p);    }        printf("malloc(%d) x %d\n", malloc_size, call_time);    for(i=0; i<malloc_size; i+=0x10000)    {      //*(char*)(p+i) = 0;      dummy = *(char*)(p+i);    }    //sleep(1);    getchar();}