src/components/rocm_smi/linux-rocm-smi.c
//----------------------------------------------------------------------------
// Ensures there is room in all Events for one more entry.
// Note we always zero added space as the default if any elements are not set.
//----------------------------------------------------------------------------
Ensures there is room in all Events for one more entry.
Note we always zero added space as the default if any elements are not set.
Ensures there is room in all Events for one more entry . Note we always zero added space as the default if any elements are not set .
static void MakeRoomAllEvents(void)
{
    if (TotalEvents < SizeAllEvents) return;    
    if (AllEvents == NULL) {         
        SizeAllEvents = 16;          
        AllEvents = calloc(SizeAllEvents, sizeof(event_info_t));
        return;
    }
    SizeAllEvents += 16;            
    AllEvents = realloc(AllEvents, SizeAllEvents*sizeof(event_info_t)); 
    memset(&AllEvents[SizeAllEvents-16], 0, 16*sizeof(event_info_t));   
}
static void MakeRoomAllEvents ( void ) { if ( TotalEvents < SizeAllEvents ) return ; if ( AllEvents == NULL ) { SizeAllEvents = 16 ; AllEvents = calloc ( SizeAllEvents , sizeof ( event_info_t ) ) ; return ; } SizeAllEvents += 16 ; AllEvents = realloc ( AllEvents , SizeAllEvents * sizeof ( event_info_t ) ) ; memset ( & AllEvents [ SizeAllEvents - 16 ] , 0 , 16 * sizeof ( event_info_t ) ) ; }
Ensures there is room in all Events for one more entry.
Ensures there is room in all Events for one more entry .
// One more will fit. // Never alloced; // Begin with 16 entries, // Must add 16 table entries. // Add 16 entries. // make more room. // clear the added room.