Branch: Tag:

2000-04-23

2000-04-23 02:42:01 by Martin Stjernholm <mast@lysator.liu.se>

Added a PTR_HASH_LOOP() macro.

Rev: src/block_alloc.h:1.20
Rev: src/block_alloc_h.h:1.7
Rev: src/las.h:1.34

10:      #define PTR_HASH_ALLOC(DATA,BSIZE) \   BLOCK_ALLOC(DATA,BSIZE) \ + extern struct DATA **PIKE_CONCAT(DATA,_hash_table); \ + extern int PIKE_CONCAT(DATA,_hash_table_size); \   struct DATA *PIKE_CONCAT(find_,DATA)(void *ptr); \   struct DATA *PIKE_CONCAT(get_,DATA)(void *ptr); \   int PIKE_CONCAT3(check_,DATA,_semafore)(void *ptr); \
17:   void PIKE_CONCAT3(init_,DATA,_hash)(void); \   void PIKE_CONCAT3(exit_,DATA,_hash)(void); \    + #define PTR_HASH_LOOP(DATA,HVAL,PTR) \ +  for ((HVAL) = PIKE_CONCAT(DATA,_hash_table_size); (HVAL)-- > 0;) \ +  for ((PTR) = PIKE_CONCAT(DATA,_hash_table)[HVAL]; \ +  (PTR); (PTR) = (PTR)->BLOCK_ALLOC_NEXT)    -  + #define BLOCK_ALLOC_NEXT next