pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1: - /* $Id: block_alloc.h,v 1.20 2001/07/04 07:01:50 hubbe Exp $ */ + /* $Id: block_alloc.h,v 1.21 2001/07/18 11:39:05 grubba 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:240:    PIKE_CONCAT(DATA,_hash_table)[hval]=p->BLOCK_ALLOC_NEXT; \    PIKE_CONCAT(really_free_,DATA)(p); \    return 1; \    } \    return 0; \   } \    \   void PIKE_CONCAT3(init_,DATA,_hash)(void) \   { \    extern INT32 hashprimes[32]; \ -  extern int my_log2(size_t x); \ +  extern int my_log2(unsigned INT32 x); \    PIKE_CONCAT(DATA,_hash_table_size)=hashprimes[my_log2(BSIZE)]; \    \    PIKE_CONCAT(DATA,_hash_table)=(struct DATA **) \    malloc(sizeof(struct DATA *)*PIKE_CONCAT(DATA,_hash_table_size)); \    if(!PIKE_CONCAT(DATA,_hash_table)) \    { \    fprintf(stderr,"Fatal: out of memory.\n"); \    exit(17); \    } \    MEMSET(PIKE_CONCAT(DATA,_hash_table),0, \    sizeof(struct DATA *)*PIKE_CONCAT(DATA,_hash_table_size)); \   } \    \   void PIKE_CONCAT3(exit_,DATA,_hash)(void) \   { \    PIKE_CONCAT3(free_all_,DATA,_blocks)(); \    free(PIKE_CONCAT(DATA,_hash_table)); \    PIKE_CONCAT(DATA,_hash_table)=0; \    PIKE_CONCAT(num_,DATA)=0; \   }