Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created June 16, 2009 23:29
Show Gist options
  • Select an option

  • Save methodmissing/130982 to your computer and use it in GitHub Desktop.

Select an option

Save methodmissing/130982 to your computer and use it in GitHub Desktop.
#ifdef HASH_LOG
static int collision = 0;
static int init_st = 0;
static void
stat_col()
{
FILE *f = fopen("/tmp/col", "w");
fprintf(f, "collision: %d\n", collision);
fclose(f);
}
#endif
st_table*
st_init_table_with_size(type, size)
struct st_hash_type *type;
int size;
{
st_table *tbl;
#ifdef HASH_LOG
if (init_st == 0) {
init_st = 1;
atexit(stat_col);
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment