Branch: Tag:

2017-03-03

2017-03-03 11:54:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Mapping: Added macro MD_FULLP().

This is a predicate that indicates whether all keypairs in a
struct mapping_data are in use or not.

Some related code clean up.

71:   #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #define NEW_MAPPING_LOOP(md) \    for((e=0) DO_IF_DMALLOC( ?0:(debug_malloc_touch(md)) ) ;e<(md)->hashsize;e++) for(k=(md)->hash[e];k;k=k->next) -  + #define MD_FULLP(md) (!(md)->free_list)   #else /* PIKE_MAPPING_KEYPAIR_LOOP */      #define NEW_MAPPING_LOOP(md) \    for(((k = MD_KEYPAIRS(md, (md)->hashsize)), e=0) DO_IF_DMALLOC( ?0:(debug_malloc_touch(md)) ) ; e<(md)->size; e++,k++) -  + #define MD_FULLP(md) ((md)->size >= (md)->num_keypairs)      #endif /* PIKE_MAPPING_KEYPAIR_LOOP */