/**
 * The "memory zum fruehstueck" OOM-killer teaser
 * gcc -o eatmem eatmem.c
 * thp <thpinfo.com/about> 2009-01-10
 **/

#include <stdlib.h>

int main()
{
    void *d;
    unsigned int i;
    while(1) {
        if (d = malloc(0xFFFF)) {
            for (i=0; i<0xFFFF; i++) {
                ((char*)d)[i] = i%0x100;
            }
        }
    }
}


