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; }
static void create_automation_values(Data *data){ int num_effects = data->voices[0].myUI._num_effects; data->automation_values = (float*)V_malloc(sizeof(float) * num_effects); for(int i=0;i<num_effects;i++){ data->automation_values[i] = -100000; } }
// Called from main thread static void GE_fill_in_shared_variables(SharedVariables *sv){ struct Tracker_Windows *window = root->song->tracker_windows; struct WBlocks *wblock = window->wblock; struct Blocks *block = wblock->block; sv->top_realline = wblock->top_realline; sv->num_reallines = wblock->num_reallines; sv->curr_realline = wblock->curr_realline; sv->fontheight = window->fontheight; sv->reltempo = block->reltempo; sv->block_duration = getBlockSTimeLength(block); sv->scrollbar_height = get_scrollbar_y2(window,wblock) - get_scrollbar_y1(window,wblock); sv->scrollbar_scroller_height = get_scrollbar_scroller_height(window,wblock); sv->block = block; sv->times = block->times; { radium::ScopedMutex locker(&vector_mutex); VECTOR_push_back(&g_times_storage, sv->times); } sv->realline_places = (Place*)V_malloc(sv->num_reallines * sizeof(Place)); for(int i=0;i<sv->num_reallines;i++){ sv->realline_places[i] = wblock->reallines[i]->l.p; } }