src/siri/db/series.c
/*
 * NEVER call this function but call siridb_series_decref instead.
 *
 * Destroy series. (parsing NULL is not allowed)
 */
NEVER call this function but call siridb_series_decref instead.
Destroy series. (parsing NULL is not allowed)
NEVER call this function but call siridb_series_decref instead . Destroy series . ( parsing NULL is not allowed )
void siridb__series_free(siridb_series_t *__restrict series)
{
#ifdef DEBUG
    if (siri.status == SIRI_STATUS_RUNNING || 0)
    {
        log_debug("Free series: '%s'", series->name);
    }
#endif
    siridb_shard_t * shard;
    for (uint_fast32_t i = 0; i < series->idx_len; i++)
    {
        shard = series->idx[i].shard;
        shard->flags |= SIRIDB_SHARD_HAS_DROPPED_SERIES;
        siridb_shard_decref(shard);
    }
    if (series->buffer != NULL)
    {
        siridb_points_free(series->buffer);
        if (series->flags & SIRIDB_SERIES_IS_DROPPED)
        {
            slist_append_safe(
                &series->siridb->empty_buffers,
                (void *) series->bf_offset);
        }
    }
    free(series->idx);
    free(series->name);
    free(series);
}
void siridb__series_free ( siridb_series_t * __restrict series ) { #ifdef DEBUG if ( siri . status == SIRI_STATUS_RUNNING || 0 ) { log_debug ( " " , series -> name ) ; } #endif siridb_shard_t * shard ; for ( uint_fast32_t i = 0 ; i < series -> idx_len ; i ++ ) { shard = series -> idx [ i ] . shard ; shard -> flags |= SIRIDB_SHARD_HAS_DROPPED_SERIES ; siridb_shard_decref ( shard ) ; } if ( series -> buffer != NULL ) { siridb_points_free ( series -> buffer ) ; if ( series -> flags & SIRIDB_SERIES_IS_DROPPED ) { slist_append_safe ( & series -> siridb -> empty_buffers , ( void * ) series -> bf_offset ) ; } } free ( series -> idx ) ; free ( series -> name ) ; free ( series ) ; }
NEVER call this function but call siridb_series_decref instead.
NEVER call this function but call siridb_series_decref instead .
/* mark shards with dropped series flag */