Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

imalloc

Name: Anonymous 2012-04-26 15:58

/*
 *    Non-failing allocation routines (init cannot fail).
 */
static
void *imalloc(size_t size)
{
    void    *m;

    while ((m = malloc(size)) == NULL) {
        initlog(L_VB, "out of memory");
        do_sleep(5);
    }
    memset(m, 0, size);
    return m;
}

Name: Anonymous 2012-04-26 17:01

just use an assert, you'll never see OOM

Name: Anonymous 2012-04-26 17:22

>>3
OOM is like that beast from X-Files s5e19

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List