osprey/kg++fe/gnu/hashtable.c File Reference

#include "config.h"
#include "system.h"
#include "hashtable.h"

Include dependency graph for hashtable.c:

Go to the source code of this file.

Defines

#define OBSTACK_CHUNK_SIZE   0
#define OBSTACK_CHUNK_ALLOC   xmalloc
#define OBSTACK_CHUNK_FREE   free
#define HASHSTEP(r, c)   ((r) * 67 + ((c) - 113));
#define SCALE(x)
#define LABEL(x)   ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))

Functions/Subroutines

static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int))
static void ht_expand PARAMS ((hash_table *))
void gcc_obstack_init (struct obstack *obstack)
static unsigned int calc_hash (unsigned char *str, unsigned int len) const
hash_tableht_create (unsigned int order)
void ht_destroy (hash_table *table)
hashnode ht_lookup (hash_table *table, const unsigned char *str, unsigned int len, enum ht_lookup_option insert)
static void ht_expand (hash_table *table)
void ht_forall (hash_table *table, ht_cb cb, const PTR v)
void ht_dump_statistics (hash_table *table)
double approx_sqrt (double x)


Define Documentation

#define HASHSTEP ( r,
c   )     ((r) * 67 + ((c) - 113));

Referenced by calc_hash(), hashf(), and rescan().

#define LABEL (  )     ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M'))

#define OBSTACK_CHUNK_ALLOC   xmalloc

Definition at line 42 of file hashtable.c.

#define OBSTACK_CHUNK_FREE   free

Definition at line 45 of file hashtable.c.

#define OBSTACK_CHUNK_SIZE   0

Definition at line 38 of file hashtable.c.

#define SCALE (  ) 

Value:

((unsigned long) ((x) < 1024*10 \
      ? (x) \
      : ((x) < 1024*1024*10 \
         ? (x) / 1024 \
         : (x) / (1024*1024))))


Function Documentation

static double approx_sqrt ( double  x  ) 

Definition at line 310 of file hashtable.c.

Referenced by ht_dump_statistics().

static unsigned int calc_hash ( unsigned char *  str,
unsigned int  len 
) const [static]

Definition at line 61 of file hashtable.c.

References HASHSTEP, n, and r.

Referenced by ht_lookup().

void gcc_obstack_init ( struct obstack obstack  ) 

hash_table* ht_create ( unsigned int  order  ) 

Definition at line 79 of file hashtable.c.

Referenced by _cpp_init_hashtable(), and init_stringpool().

void ht_destroy ( hash_table table  ) 

Definition at line 100 of file hashtable.c.

Referenced by _cpp_destroy_hashtable().

void ht_dump_statistics ( hash_table table  ) 

Definition at line 244 of file hashtable.c.

Referenced by stringpool_statistics().

static void ht_expand ( hash_table table  )  [static]

Definition at line 181 of file hashtable.c.

References free(), index(), p, size, and xcalloc().

Referenced by ht_lookup(), and ht_lookup_with_hash().

void ht_forall ( hash_table table,
ht_cb  cb,
const PTR  v 
)

Definition at line 223 of file hashtable.c.

References p.

Referenced by cpp_forall_identifiers(), ggc_mark_stringpool(), and mark_ident_hash().

hashnode ht_lookup ( hash_table table,
const unsigned char *  str,
unsigned int  len,
enum ht_lookup_option  insert 
)

static void ht_expand PARAMS ( (hash_table *)   )  [static]

static unsigned int calc_hash PARAMS ( (const unsigned char *, unsigned int)   )  [static]


Generated on Wed Apr 8 15:35:12 2009 for Open64 by  doxygen 1.5.6