ext/iodine/fio.c
/** Creates / finds a pattern channel, adds a reference count and locks it. */
Creates / finds a pattern channel, adds a reference count and locks it.
Creates / finds a pattern channel adds a reference count and locks it .
static channel_s *fio_channel_match_dup_lock(fio_str_info_s name,
                                             fio_match_fn match) {
  channel_s ch = (channel_s){
      .name = name.data,
      .name_len = name.len,
      .parent = &fio_postoffice.patterns,
      .match = match,
      .ref = 8, 
  };
  uint64_t hashed_name = FIO_HASH_FN(
      name.data, name.len, &fio_postoffice.pubsub, &fio_postoffice.pubsub);
  channel_s *ch_p =
      fio_filter_dup_lock_internal(&ch, hashed_name, &fio_postoffice.patterns);
  if (fio_ls_embd_is_empty(&ch_p->subscriptions)) {
    fio_pubsub_on_channel_create(ch_p);
  }
  return ch_p;
}
static channel_s * fio_channel_match_dup_lock ( fio_str_info_s name , fio_match_fn match ) { channel_s ch = ( channel_s ) { . name = name . data , . name_len = name . len , . parent = & fio_postoffice . patterns , . match = match , . ref = 8 , } ; uint64_t hashed_name = FIO_HASH_FN ( name . data , name . len , & fio_postoffice . pubsub , & fio_postoffice . pubsub ) ; channel_s * ch_p = fio_filter_dup_lock_internal ( & ch , hashed_name , & fio_postoffice . patterns ) ; if ( fio_ls_embd_is_empty ( & ch_p -> subscriptions ) ) { fio_pubsub_on_channel_create ( ch_p ) ; } return ch_p ; }
Creates / finds a pattern channel, adds a reference count and locks it.
Creates / finds a pattern channel adds a reference count and locks it .
/* avoid freeing stack memory */