GDB (xrefs)
Classes | Defines | Functions
/home/stan/gdb/src/gdb/bcache.c File Reference
#include "defs.h"
#include "gdb_obstack.h"
#include "bcache.h"
#include "gdb_string.h"
#include "gdb_assert.h"
#include <stddef.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  bstring
struct  bcache

Defines

#define CHAIN_LENGTH_THRESHOLD   (5)
#define BSTRING_SIZE(n)   (offsetof (struct bstring, d.data) + (n))

Functions

unsigned long hash (const void *addr, int length)
unsigned long hash_continue (const void *addr, int length, unsigned long h)
static void expand_hash_table (struct bcache *bcache)
const void * bcache (const void *addr, int length, struct bcache *cache)
const void * bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
static int bcache_compare (const void *addr1, const void *addr2, int length)
struct bcachebcache_xmalloc (unsigned long(*hash_function)(const void *, int length), int(*compare_function)(const void *, const void *, int length))
void bcache_xfree (struct bcache *bcache)
static void print_percentage (int portion, int total)
void print_bcache_statistics (struct bcache *c, char *type)
int bcache_memory_used (struct bcache *bcache)

Define Documentation

#define BSTRING_SIZE (   n)    (offsetof (struct bstring, d.data) + (n))

Definition at line 205 of file bcache.c.

Referenced by bcache_full().

#define CHAIN_LENGTH_THRESHOLD   (5)

Definition at line 129 of file bcache.c.

Referenced by bcache_full().


Function Documentation

const void* bcache ( const void *  addr,
int  length,
struct bcache cache 
)

Definition at line 211 of file bcache.c.

References bcache_full().

Referenced by elf_symtab_read(), macro_bcache(), and psymbol_bcache_init().

static int bcache_compare ( const void *  addr1,
const void *  addr2,
int  length 
) [static]

Definition at line 297 of file bcache.c.

References memcmp().

Referenced by bcache_xmalloc().

const void* bcache_full ( const void *  addr,
int  length,
struct bcache bcache,
int added 
)
int bcache_memory_used ( struct bcache bcache)

Definition at line 490 of file bcache.c.

References bcache::cache, and bcache::total_count.

Referenced by print_objfile_statistics().

void bcache_xfree ( struct bcache bcache)
struct bcache* bcache_xmalloc ( unsigned long(*)(const void *, int length)  hash_function,
int(*)(const void *, const void *, int length)  compare_function 
) [read]
static void expand_hash_table ( struct bcache bcache) [static]
unsigned long hash ( const void *  addr,
int  length 
)
unsigned long hash_continue ( const void *  addr,
int  length,
unsigned long  h 
)

Definition at line 111 of file bcache.c.

References bstring::length.

Referenced by hash(), and psymbol_hash().

void print_bcache_statistics ( struct bcache c,
char *  type 
)
static void print_percentage ( int  portion,
int  total 
) [static]

Definition at line 348 of file bcache.c.

References _, and printf_filtered().

Referenced by print_bcache_statistics().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines