All pastes #395745 Raw Edit

Something

public text v1 · immutable
·published 2007-03-15 08:07 UTC
rendered paste body
void put_hashset (hashset_ref h, hashset_key_t k) {
   unsigned int index;
 hashnode_ref e=NULL;
   e = malloc(sizeof(struct hashnode));
  //  if (NULL == e) { ++(h->load_count); return ; } 
  
    index = strhash(k)%h->header_dim;
    printf("unsign is %u\n",index);
    e->key = k;
  
    //e->link = h->headers[index];
    h->headers[index] = e;

   /*hashnode_ref *entry=NULL;
   
   int modkey= strhash(key);
   entry=malloc(sizeof(struct hashnode));
   modkey= modkey%hash->header_dim;
   
   printf("modkey = %d\n",modkey);
   
   hash->headers[modkey]=entry;
    hash->load_count++;
   */
   h->load_count++;
   STUBPRINTF ("put_hashset (0x%p, %s%d\n)", h, k, h->load_count);
}