예제 #1
0
static inline void
s_clean(mccp_hashmap_t hm, bool free_values) {
  if (free_values == true) {
    s_freeup_all_values(hm);
  }
  DeleteHashTable(&(hm->m_hashtable));
  (void)memset(&(hm->m_hashtable), 0, sizeof(HashTable));
  hm->m_n_entries = 0;
}
예제 #2
0
static inline void
s_clean(lagopus_cbuffer_t cb, bool free_values) {
  if (cb != NULL) {
    if (free_values == true) {
      s_freeup_all_values(cb);
    }
    cb->m_r_idx = 0;
    cb->m_w_idx = 0;
    (void)memset((void *)(cb->m_data), 0,
                 cb->m_element_size * (size_t)cb->m_n_max_allocd_elements);
    cb->m_n_elements = 0;
  }
}