pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:714:    md->hardlinks--;    md->valrefs--;    }    sub_ref(md);       return nmd;   }      #define MAPPING_DATA_IN_USE(MD) ((MD)->refs != (MD)->hardlinks + 1)    + /** +  * void LOW_FIND(int (*FUN)(const struct svalue *IND, const struct svalue *KEY), +  * const struct svalue *KEY, +  * CODE_IF_FOUND, +  * CODE_IF_NOT_FOUND) +  * +  * Needs local variables: +  * struct mapping *m; +  * struct mapping_data *md; +  * size_t h, h2; +  * struct svalue *key; +  * struct keypair *k, **prev; +  * +  * CODE_IF_FOUND must end with a return, goto or longjmp to +  * avoid CODE_IF_NOT_FOUND being called afterwards, or for +  * potential multiple matches. +  * +  * On entry: +  * m is the mapping to search. +  * key === KEY. +  * h2 = hash_svalue(key). +  * +  * Internals: +  * md = m->data. +  * md gets an extra ref. +  * +  * When CODE_IF_FOUND gets executed k points to the matching keypair. +  */   #define LOW_FIND(FUN, KEY, FOUND, NOT_FOUND) do { \    md=m->data; \    add_ref(md); \    if(md->hashsize) \    { \    h=h2 & (md->hashsize - 1); \    DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \    if(check_type_contains(md->ind_types, key)) \    { \    for(prev= md->hash + h;(k=*prev);prev=&k->next) \