pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1: - /* $Id: block_alloc.h,v 1.16 2000/03/20 21:00:03 hubbe Exp $ */ + /* $Id: block_alloc.h,v 1.17 2000/03/22 00:55:07 hubbe Exp $ */   #undef PRE_INIT_BLOCK   #undef INIT_BLOCK   #undef EXIT_BLOCK   #undef BLOCK_ALLOC   #undef PTR_HASH_ALLOC   #undef COUNT_BLOCK   #undef COUNT_OTHER      #define PRE_INIT_BLOCK(X)   #define INIT_BLOCK(X)
pike.git/src/block_alloc.h:104:   BLOCK_ALLOC(DATA,BSIZE) \    \   static struct DATA **PIKE_CONCAT(DATA,_hash_table)=0; \   static int PIKE_CONCAT(DATA,_hash_table_size)=0; \   static int PIKE_CONCAT(num_,DATA)=0; \    \   inline struct DATA * \    PIKE_CONCAT(really_low_find_,DATA)(void *ptr, int hval) \   { \    struct DATA *p,**pp; \ -  for(pp=PIKE_CONCAT(DATA,_hash_table)+hval;(p=*pp);pp=&p->BLOCK_ALLOC_NEXT) \ +  p=PIKE_CONCAT(DATA,_hash_table)[hval]; \ +  if(!p) return 0; \ +  if(p->data == ptr) return p; \ +  while((p=*(pp=&p->BLOCK_ALLOC_NEXT))) \    { \    if(p->data==ptr) \    { \    *pp=p->BLOCK_ALLOC_NEXT; \    p->BLOCK_ALLOC_NEXT=PIKE_CONCAT(DATA,_hash_table)[hval]; \    PIKE_CONCAT(DATA,_hash_table)[hval]=p; \    return p; \    } \    } \    return 0; \