diff --git a/src/block_alloc.h b/src/block_alloc.h index 8d304bbd3125b0ebc9070ff3c69735b590aa263b..3e99bdfdf2e1f76590c4ce786a22a5b020a4c423 100644 --- a/src/block_alloc.h +++ b/src/block_alloc.h @@ -1,4 +1,4 @@ -/* $Id: block_alloc.h,v 1.19 2000/04/17 21:06:24 hubbe Exp $ */ +/* $Id: block_alloc.h,v 1.20 2000/04/23 02:42:01 mast Exp $ */ #undef PRE_INIT_BLOCK #undef INIT_BLOCK #undef EXIT_BLOCK @@ -112,8 +112,8 @@ void PIKE_CONCAT3(count_memory_in_,DATA,s)(INT32 *num_, INT32 *size_) \ \ BLOCK_ALLOC(DATA,BSIZE) \ \ -static struct DATA **PIKE_CONCAT(DATA,_hash_table)=0; \ -static int PIKE_CONCAT(DATA,_hash_table_size)=0; \ +struct DATA **PIKE_CONCAT(DATA,_hash_table)=0; \ +int PIKE_CONCAT(DATA,_hash_table_size)=0; \ static int PIKE_CONCAT(num_,DATA)=0; \ \ inline struct DATA * \ @@ -267,6 +267,3 @@ void PIKE_CONCAT3(exit_,DATA,_hash)(void) \ PIKE_CONCAT(DATA,_hash_table)=0; \ PIKE_CONCAT(num_,DATA)=0; \ } - -#define BLOCK_ALLOC_NEXT next - diff --git a/src/block_alloc_h.h b/src/block_alloc_h.h index 49a45ab6bab8cba2485af35b7539d382de4121a4..238787a8fad44abb9582ef7acd92579bc52205e9 100644 --- a/src/block_alloc_h.h +++ b/src/block_alloc_h.h @@ -10,6 +10,8 @@ void PIKE_CONCAT3(count_memory_in_,DATA,s)(INT32 *num, INT32 *size); \ #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,4 +19,9 @@ int PIKE_CONCAT(remove_,DATA)(void *ptr); \ 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 diff --git a/src/las.h b/src/las.h index 00723dfdaa964835911c33ed794cbd73cb8b3777..b1f71a36735958c3444ce8c7b550fc2c0d2e283f 100644 --- a/src/las.h +++ b/src/las.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: las.h,v 1.33 1999/12/29 17:54:03 grubba Exp $ + * $Id: las.h,v 1.34 2000/04/23 02:42:01 mast Exp $ */ #ifndef LAS_H #define LAS_H @@ -15,6 +15,7 @@ #include "svalue.h" #include "dynamic_buffer.h" #include "program.h" +#include "block_alloc_h.h" #define MAX_GLOBAL_VARIABLES 1000 typedef void (*c_fun)(INT32);