Listing 2
void *xalloc(size_t size) { void *p; assert(size); BEGIN_TRY { /* get some RAM */ if (!(p = malloc(size))) { assert(errno == ENOMEM); FAIL(X_ERRNO); } } FAIL_TRY { /* no RAM, so cram */ if (X_Error == X_ERRNO) if (errno == ENOMEM) if (CompactMem(size)) RETRY; } END_TRY; assert(p); return p; } /* End of File */