void OnOutOfMemory() { free(EmergencyReserve); fprintf(stderr, "\n*** OUT OF MEMORY ***\n"); fprintf(stderr, "Memory allocated so far %g MB\n", GetMemUseMB()); extern MSA *ptrBestMSA; if (ptrBestMSA == 0) fprintf(stderr, "No alignment generated\n"); else SaveCurrentAlignment(); exit(EXIT_FatalError); }
void CheckMaxTime() { if (0 == g_ulMaxSecs.get()) return; time_t Now = time(0); time_t ElapsedSecs = Now - GetStartTime(); if (ElapsedSecs <= (time_t) g_ulMaxSecs.get()) return; Log("Max time %s exceeded, elapsed seconds = %ul\n", MaxSecsToStr(), ElapsedSecs); SaveCurrentAlignment(); exit(EXIT_Success); }