struct PEventQueue *GetPEQelement(void) { struct PEventQueue *temp=peqroot; if(temp==NULL) { // This should REALLY not happen. //temp=GC_malloc(sizeof(struct PEventQueue)); temp=V_malloc(sizeof(struct PEventQueue)); if(temp==NULL) { RT_message("Error. Out of memory on a very bad place. Now probably crashing.\n"); } } else { peqroot=NextPEventQueue(temp); } ++num_elements_used; //printf(" +NUM ELEMENTS: %d\n",num_elements_used); if(num_elements_used > INITIAL_NUM_ELEMENTS-SAFETY_BUFFER) { RT_message("<p>Stopping player.</p><p>We are at risk of running out of memory for the player.</p>This is a bug in Radium, and is not supposed to happen.</p><p>Please report this bug.</p>"); RT_request_to_stop_playing(); } return temp; }
void CRASHREPORTER_send_assert_message(Crash_Type crash_type, const char *fmt,...){ static bool is_currently_sending = false; #if 0 static int last_time = -10000; if ( last_time < (running_time.elapsed()-(30*1000))) return; last_time = running_time.elapsed(); #endif if (is_currently_sending) return; char message[1000]; va_list argp; va_start(argp,fmt); /* vfprintf(stderr,fmt,argp); */ vsprintf(message,fmt,argp); va_end(argp); if (g_crashreporter_file!=NULL) { if (!g_crashreporter_file->open()){ SYSTEM_show_message("Unable to create temprary file. Disk may be full"); send_crash_message_to_server(message, get_plugin_names(), NOEMERGENCYSAVE, crash_type); goto exit; } if (false==file_is_empty(g_crashreporter_file)) { g_crashreporter_file->close(); goto exit; } g_crashreporter_file->close(); } is_currently_sending = true; RT_request_to_stop_playing(); RT_pause_plugins(); CRASHREPORTER_send_message_with_backtrace(message, crash_type); #if 0 if (may_do_blocking && THREADING_is_main_thread()) send_crash_message_to_server(message, g_plugin_name, false); else{ const char *messages[1] = {message}; CRASHREPORTER_send_message(messages, 1, false); } #endif exit: is_currently_sending = false; }