Branch: Tag:

2000-02-01

2000-02-01 23:51:48 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

rehash() rewritten (now 100% atomic)

Rev: src/mapping.c:1.57
Rev: src/mapping.h:1.20

5:   \*/      /* -  * $Id: mapping.h,v 1.19 2000/02/01 06:25:07 hubbe Exp $ +  * $Id: mapping.h,v 1.20 2000/02/01 23:51:48 hubbe Exp $    */   #ifndef MAPPING_H   #define MAPPING_H
18:   struct keypair   {    struct keypair *next; +  unsigned INT32 hval;    struct svalue ind, val;   };   
62:    for((e=0) DO_IF_DMALLOC( ?0:(debug_malloc_touch(m),debug_malloc_touch(m->data))) ;e<m->data->hashsize;e++) for(k=m->data->hash[e];k;k=k->next)      #define free_mapping(M) do{ struct mapping *m_=(M); debug_malloc_touch(m_); if(!--m_->refs) really_free_mapping(m_); }while(0) - #define free_mapping_data(M) do{ struct mapping_data *md_=(M); debug_malloc_touch(md_); if(!--md_->refs) really_free_mapping_data(md_); }while(0) +     -  + #define free_mapping_data(M) do{ \ +  struct mapping_data *md_=(M); \ +  debug_malloc_touch(md_); \ +  if(!--md_->refs) really_free_mapping_data(md_); \ + }while(0) +    /* Prototypes begin here */   BLOCK_ALLOC(mapping, 511)