ext/iodine/redis_engine.c
/** cleans up and frees the engine data. */
cleans up and frees the engine data.
cleans up and frees the engine data .
static inline void redis_free(redis_engine_s *r) {
  if (fio_atomic_sub(&r->ref, 1))
    return;
  FIO_LOG_DEBUG("freeing redis engine for %s:%s", r->address, r->port);
  redis_internal_reset(&r->pub_data);
  redis_internal_reset(&r->sub_data);
  fiobj_free(r->last_ch);
  while (fio_ls_embd_any(&r->queue)) {
    fio_free(
        FIO_LS_EMBD_OBJ(redis_commands_s, node, fio_ls_embd_pop(&r->queue)));
  }
  fio_unsubscribe(r->publication_forwarder);
  r->publication_forwarder = NULL;
  fio_unsubscribe(r->cmd_forwarder);
  r->cmd_forwarder = NULL;
  fio_unsubscribe(r->cmd_reply);
  r->cmd_reply = NULL;
  fio_free(r);
}
static inline void redis_free ( redis_engine_s * r ) { if ( fio_atomic_sub ( & r -> ref , 1 ) ) return ; FIO_LOG_DEBUG ( " " , r -> address , r -> port ) ; redis_internal_reset ( & r -> pub_data ) ; redis_internal_reset ( & r -> sub_data ) ; fiobj_free ( r -> last_ch ) ; while ( fio_ls_embd_any ( & r -> queue ) ) { fio_free ( FIO_LS_EMBD_OBJ ( redis_commands_s , node , fio_ls_embd_pop ( & r -> queue ) ) ) ; } fio_unsubscribe ( r -> publication_forwarder ) ; r -> publication_forwarder = NULL ; fio_unsubscribe ( r -> cmd_forwarder ) ; r -> cmd_forwarder = NULL ; fio_unsubscribe ( r -> cmd_reply ) ; r -> cmd_reply = NULL ; fio_free ( r ) ; }
cleans up and frees the engine data.
cleans up and frees the engine data .