st.c File Reference

#include "ruby/ruby.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  st_table_entry
struct  st_packed_entry

Defines

#define STATIC_ASSERT(name, expr)   typedef int static_assert_##name##_check[(expr) ? 1 : -1];
#define ST_DEFAULT_MAX_DENSITY   5
#define ST_DEFAULT_INIT_TABLE_SIZE   11
#define ST_DEFAULT_SECOND_TABLE_SIZE   19
#define ST_DEFAULT_PACKED_TABLE_SIZE   18
#define PACKED_UNIT   (int)(sizeof(st_packed_entry) / sizeof(st_table_entry*))
#define MAX_PACKED_HASH   (int)(ST_DEFAULT_PACKED_TABLE_SIZE * sizeof(st_table_entry*) / sizeof(st_packed_entry))
#define type_numhash   st_hashtype_num
#define malloc   xmalloc
#define calloc   xcalloc
#define realloc   xrealloc
#define free(x)   xfree(x)
#define numberof(array)   (int)(sizeof(array) / sizeof((array)[0]))
#define EQUAL(table, x, y)   ((x)==(y) || (*(table)->type->compare)((x),(y)) == 0)
#define do_hash(key, table)   (st_index_t)(*(table)->type->hash)((key))
#define do_hash_bin(key, table)   (do_hash((key), (table))%(table)->num_bins)
#define st_alloc_entry()   (st_table_entry *)malloc(sizeof(st_table_entry))
#define st_free_entry(entry)   free(entry)
#define st_alloc_table()   (st_table *)malloc(sizeof(st_table))
#define st_dealloc_table(table)   free(table)
#define st_alloc_bins(size)   (st_table_entry **)calloc(size, sizeof(st_table_entry *))
#define st_free_bins(bins, size)   free(bins)
#define bins   as.big.bins
#define head   as.big.head
#define tail   as.big.tail
#define real_entries   as.packed.real_entries
#define PACKED_BINS(table)   ((table)->as.packed.entries)
#define PACKED_ENT(table, i)   PACKED_BINS(table)[i]
#define PKEY(table, i)   PACKED_ENT((table), (i)).key
#define PVAL(table, i)   PACKED_ENT((table), (i)).val
#define PHASH(table, i)   PACKED_ENT((table), (i)).hash
#define PKEY_SET(table, i, v)   (PKEY((table), (i)) = (v))
#define PVAL_SET(table, i, v)   (PVAL((table), (i)) = (v))
#define PHASH_SET(table, i, v)   (PHASH((table), (i)) = (v))
#define MINSIZE   8
#define PTR_NOT_EQUAL(table, ptr, hash_val, key)   ((ptr) != 0 && ((ptr)->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key)))
#define COLLISION
#define FOUND_ENTRY
#define FIND_ENTRY(table, ptr, hash_val, bin_pos)   ((ptr) = find_entry((table), key, (hash_val), ((bin_pos) = (hash_val)%(table)->num_bins)))
#define collision_check   0
#define collision_check   1
#define FNV1_32A_INIT   0x811c9dc5
#define FNV_32_PRIME   0x01000193
#define MURMUR   2
#define MurmurMagic_1   (st_index_t)0xc6a4a793
#define MurmurMagic_2   (st_index_t)0x5bd1e995
#define MurmurMagic   MurmurMagic_2
#define murmur_step(h, k)   murmur((h), (k), 16)
#define murmur1(h)   murmur_step((h), 24)
#define data_at(n)   (st_index_t)((unsigned char)data[(n)])
#define UNALIGNED_ADD_4   UNALIGNED_ADD(2); UNALIGNED_ADD(1); UNALIGNED_ADD(0)
#define UNALIGNED_ADD_ALL   UNALIGNED_ADD_4
#define UNALIGNED_ADD(n)
#define UNALIGNED_ADD(n)
#define UNALIGNED_ADD(n)

Typedefs

typedef struct st_table_entry st_table_entry

Functions

 STATIC_ASSERT (st_packed_entry, sizeof(st_packed_entry)==sizeof(st_table_entry *[PACKED_UNIT]))
static st_index_t strhash (st_data_t)
static st_index_t strcasehash (st_data_t)
static void rehash (st_table *)
static st_table_entry ** st_realloc_bins (st_table_entry **bins, st_index_t newsize, st_index_t oldsize)
static void remove_packed_entry (st_table *table, st_index_t i)
static void remove_safe_packed_entry (st_table *table, st_index_t i, st_data_t never)
static st_index_t new_size (st_index_t size)
st_table * st_init_table_with_size (const struct st_hash_type *type, st_index_t size)
st_table * st_init_table (const struct st_hash_type *type)
st_table * st_init_numtable (void)
st_table * st_init_numtable_with_size (st_index_t size)
st_table * st_init_strtable (void)
st_table * st_init_strtable_with_size (st_index_t size)
st_table * st_init_strcasetable (void)
st_table * st_init_strcasetable_with_size (st_index_t size)
void st_clear (st_table *table)
void st_free_table (st_table *table)
size_t st_memsize (const st_table *table)
static st_table_entryfind_entry (st_table *table, st_data_t key, st_index_t hash_val, st_index_t bin_pos)
static st_index_t find_packed_index_from (st_table *table, st_index_t hash_val, st_data_t key, st_index_t i)
static st_index_t find_packed_index (st_table *table, st_index_t hash_val, st_data_t key)
int st_lookup (st_table *table, register st_data_t key, st_data_t *value)
int st_get_key (st_table *table, register st_data_t key, st_data_t *result)
static st_table_entrynew_entry (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val, register st_index_t bin_pos)
static void add_direct (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val, register st_index_t bin_pos)
static void unpack_entries (register st_table *table)
static void add_packed_direct (st_table *table, st_data_t key, st_data_t value, st_index_t hash_val)
int st_insert (register st_table *table, register st_data_t key, st_data_t value)
int st_insert2 (register st_table *table, register st_data_t key, st_data_t value, st_data_t(*func)(st_data_t))
void st_add_direct (st_table *table, st_data_t key, st_data_t value)
static void rehash (register st_table *table)
st_table * st_copy (st_table *old_table)
static void remove_entry (st_table *table, st_table_entry *ptr)
int st_delete (register st_table *table, register st_data_t *key, st_data_t *value)
int st_delete_safe (register st_table *table, register st_data_t *key, st_data_t *value, st_data_t never)
void st_cleanup_safe (st_table *table, st_data_t never)
int st_update (st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg)
int st_foreach_check (st_table *table, int(*func)(ANYARGS), st_data_t arg, st_data_t never)
int st_foreach (st_table *table, int(*func)(ANYARGS), st_data_t arg)
static st_index_t murmur (st_index_t h, st_index_t k, int r)
static st_index_t murmur_finish (st_index_t h)
st_index_t st_hash (const void *ptr, size_t len, st_index_t h)
st_index_t st_hash_uint32 (st_index_t h, uint32_t i)
st_index_t st_hash_uint (st_index_t h, st_index_t i)
st_index_t st_hash_end (st_index_t h)
st_index_t st_hash_start (st_index_t h)
int st_strcasecmp (const char *s1, const char *s2)
int st_strncasecmp (const char *s1, const char *s2, size_t n)
int st_numcmp (st_data_t x, st_data_t y)
st_index_t st_numhash (st_data_t n)

Variables

static struct st_hash_type type_strhash
static struct st_hash_type type_strcasehash
static const unsigned int primes []

Define Documentation

#define bins   as.big.bins

Definition at line 106 of file st.c.

#define calloc   xcalloc

Definition at line 78 of file st.c.

#define COLLISION

Definition at line 373 of file st.c.

Referenced by find_entry().

#define collision_check   1

Definition at line 470 of file st.c.

#define collision_check   0

Definition at line 470 of file st.c.

#define data_at (  )     (st_index_t)((unsigned char)data[(n)])
#define do_hash ( key,
table   )     (st_index_t)(*(table)->type->hash)((key))
#define do_hash_bin ( key,
table   )     (do_hash((key), (table))%(table)->num_bins)

Definition at line 88 of file st.c.

#define EQUAL ( table,
x,
 )     ((x)==(y) || (*(table)->type->compare)((x),(y)) == 0)

Definition at line 85 of file st.c.

Referenced by find_packed_index_from(), st_delete(), and st_delete_safe().

#define FIND_ENTRY ( table,
ptr,
hash_val,
bin_pos   )     ((ptr) = find_entry((table), key, (hash_val), ((bin_pos) = (hash_val)%(table)->num_bins)))

Definition at line 377 of file st.c.

Referenced by st_foreach(), st_foreach_check(), st_insert(), st_insert2(), and st_update().

#define FNV1_32A_INIT   0x811c9dc5

Definition at line 1221 of file st.c.

Referenced by strcasehash(), and strhash().

#define FNV_32_PRIME   0x01000193

Definition at line 1226 of file st.c.

Referenced by strcasehash().

#define FOUND_ENTRY

Definition at line 374 of file st.c.

Referenced by find_entry().

#define free (  )     xfree(x)

Definition at line 80 of file st.c.

#define head   as.big.head
#define malloc   xmalloc

Definition at line 77 of file st.c.

#define MAX_PACKED_HASH   (int)(ST_DEFAULT_PACKED_TABLE_SIZE * sizeof(st_table_entry*) / sizeof(st_packed_entry))

Definition at line 40 of file st.c.

#define MINSIZE   8

Definition at line 146 of file st.c.

Referenced by new_size().

#define MURMUR   2

Definition at line 1262 of file st.c.

#define murmur1 (  )     murmur_step((h), 24)

Definition at line 1315 of file st.c.

Referenced by st_hash_uint().

#define murmur_step ( h,
 )     murmur((h), (k), 16)

Definition at line 1310 of file st.c.

Referenced by st_hash(), st_hash_end(), and st_hash_uint32().

#define MurmurMagic   MurmurMagic_2

Definition at line 1273 of file st.c.

Referenced by murmur(), murmur_finish(), and st_hash().

#define MurmurMagic_1   (st_index_t)0xc6a4a793

Definition at line 1265 of file st.c.

#define MurmurMagic_2   (st_index_t)0x5bd1e995

Definition at line 1266 of file st.c.

#define numberof ( array   )     (int)(sizeof(array) / sizeof((array)[0]))

Definition at line 83 of file st.c.

#define PACKED_BINS ( table   )     ((table)->as.packed.entries)

Definition at line 112 of file st.c.

Referenced by unpack_entries().

#define PACKED_ENT ( table,
 )     PACKED_BINS(table)[i]

Definition at line 113 of file st.c.

Referenced by remove_packed_entry(), and st_cleanup_safe().

#define PACKED_UNIT   (int)(sizeof(st_packed_entry) / sizeof(st_table_entry*))

Definition at line 39 of file st.c.

#define PHASH ( table,
 )     PACKED_ENT((table), (i)).hash

Definition at line 116 of file st.c.

Referenced by find_packed_index_from(), st_foreach(), and st_foreach_check().

#define PHASH_SET ( table,
i,
 )     (PHASH((table), (i)) = (v))

Definition at line 119 of file st.c.

Referenced by add_packed_direct(), and remove_safe_packed_entry().

#define PKEY ( table,
 )     PACKED_ENT((table), (i)).key
#define PKEY_SET ( table,
i,
 )     (PKEY((table), (i)) = (v))

Definition at line 117 of file st.c.

Referenced by add_packed_direct(), and remove_safe_packed_entry().

#define PTR_NOT_EQUAL ( table,
ptr,
hash_val,
key   )     ((ptr) != 0 && ((ptr)->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key)))

Definition at line 352 of file st.c.

Referenced by find_entry().

#define PVAL ( table,
 )     PACKED_ENT((table), (i)).val

Definition at line 115 of file st.c.

Referenced by st_delete(), st_delete_safe(), st_foreach(), st_foreach_check(), st_lookup(), and st_update().

#define PVAL_SET ( table,
i,
 )     (PVAL((table), (i)) = (v))

Definition at line 118 of file st.c.

Referenced by add_packed_direct(), remove_safe_packed_entry(), st_insert(), st_insert2(), and st_update().

#define real_entries   as.packed.real_entries
#define realloc   xrealloc

Definition at line 79 of file st.c.

#define st_alloc_bins ( size   )     (st_table_entry **)calloc(size, sizeof(st_table_entry *))

Definition at line 95 of file st.c.

Referenced by st_copy(), and st_init_table_with_size().

 
#define st_alloc_entry (  )     (st_table_entry *)malloc(sizeof(st_table_entry))

Definition at line 91 of file st.c.

Referenced by new_entry(), and st_copy().

 
#define st_alloc_table (  )     (st_table *)malloc(sizeof(st_table))

Definition at line 93 of file st.c.

Referenced by st_copy(), and st_init_table_with_size().

#define st_dealloc_table ( table   )     free(table)

Definition at line 94 of file st.c.

Referenced by st_copy(), and st_free_table().

#define ST_DEFAULT_INIT_TABLE_SIZE   11

Definition at line 36 of file st.c.

Referenced by unpack_entries().

#define ST_DEFAULT_MAX_DENSITY   5

Definition at line 35 of file st.c.

Referenced by add_direct().

#define ST_DEFAULT_PACKED_TABLE_SIZE   18

Definition at line 38 of file st.c.

#define ST_DEFAULT_SECOND_TABLE_SIZE   19

Definition at line 37 of file st.c.

#define st_free_bins ( bins,
size   )     free(bins)

Definition at line 96 of file st.c.

Referenced by st_free_table().

#define st_free_entry ( entry   )     free(entry)

Definition at line 92 of file st.c.

Referenced by st_cleanup_safe(), st_clear(), st_delete(), st_foreach(), and st_update().

#define STATIC_ASSERT ( name,
expr   )     typedef int static_assert_##name##_check[(expr) ? 1 : -1];

Definition at line 33 of file st.c.

#define tail   as.big.tail
#define type_numhash   st_hashtype_num
#define UNALIGNED_ADD (  ) 
Value:
case (n) + 1: \
        t |= data_at(n) << CHAR_BIT*(n)
#define UNALIGNED_ADD (  ) 
Value:
case (n) + 1: \
                d |= data_at(n) << CHAR_BIT*(n)
#define UNALIGNED_ADD (  ) 
Value:
case SIZEOF_ST_INDEX_T - (n) - 1:       \
                t |= data_at(n) << CHAR_BIT*(n)
#define UNALIGNED_ADD_4   UNALIGNED_ADD(2); UNALIGNED_ADD(1); UNALIGNED_ADD(0)
#define UNALIGNED_ADD_ALL   UNALIGNED_ADD_4

Referenced by st_hash().


Typedef Documentation

Definition at line 18 of file st.c.


Function Documentation

static void add_direct ( st_table *  table,
st_data_t  key,
st_data_t  value,
st_index_t  hash_val,
register st_index_t  bin_pos 
) [inline, static]
static void add_packed_direct ( st_table *  table,
st_data_t  key,
st_data_t  value,
st_index_t  hash_val 
) [static]

Definition at line 547 of file st.c.

References add_direct(), PHASH_SET, PKEY_SET, PVAL_SET, and unpack_entries().

Referenced by st_add_direct(), st_insert(), st_insert2(), and st_update().

static st_table_entry* find_entry ( st_table *  table,
st_data_t  key,
st_index_t  hash_val,
st_index_t  bin_pos 
) [static]

Definition at line 381 of file st.c.

References COLLISION, FOUND_ENTRY, st_table_entry::next, and PTR_NOT_EQUAL.

Referenced by st_get_key(), and st_lookup().

static st_index_t find_packed_index ( st_table *  table,
st_index_t  hash_val,
st_data_t  key 
) [inline, static]
static st_index_t find_packed_index_from ( st_table *  table,
st_index_t  hash_val,
st_data_t  key,
st_index_t  i 
) [inline, static]

Definition at line 396 of file st.c.

References EQUAL, PHASH, PKEY, and real_entries.

Referenced by find_packed_index(), and st_foreach_check().

static st_index_t murmur ( st_index_t  h,
st_index_t  k,
int  r 
) [inline, static]

Definition at line 1278 of file st.c.

References MurmurMagic.

Referenced by murmur_finish().

static st_index_t murmur_finish ( st_index_t  h  )  [inline, static]

Definition at line 1297 of file st.c.

References murmur(), and MurmurMagic.

Referenced by st_hash().

static st_table_entry* new_entry ( st_table *  table,
st_data_t  key,
st_data_t  value,
st_index_t  hash_val,
register st_index_t  bin_pos 
) [inline, static]
static st_index_t new_size ( st_index_t  size  )  [static]

Definition at line 184 of file st.c.

References MINSIZE, numberof, rb_eRuntimeError, and rb_raise().

Referenced by onigenc_property_list_add_property(), rehash(), and st_init_table_with_size().

static void rehash ( register st_table *  table  )  [static]
static void rehash ( st_table *   )  [static]

Referenced by add_direct().

static void remove_entry ( st_table *  table,
st_table_entry ptr 
) [inline, static]

Definition at line 712 of file st.c.

References st_table_entry::back, and st_table_entry::fore.

Referenced by st_delete(), st_delete_safe(), st_foreach(), st_foreach_check(), and st_update().

static void remove_packed_entry ( st_table *  table,
st_index_t  i 
) [inline, static]

Definition at line 123 of file st.c.

References MEMMOVE, PACKED_ENT, and real_entries.

Referenced by st_delete(), st_foreach(), and st_update().

static void remove_safe_packed_entry ( st_table *  table,
st_index_t  i,
st_data_t  never 
) [inline, static]

Definition at line 134 of file st.c.

References PHASH_SET, PKEY_SET, and PVAL_SET.

Referenced by st_delete_safe(), and st_foreach_check().

void st_add_direct ( st_table *  table,
st_data_t  key,
st_data_t  value 
)
void st_cleanup_safe ( st_table *  table,
st_data_t  never 
)

Definition at line 802 of file st.c.

References st_table_entry::key, last, st_table_entry::next, PACKED_ENT, PKEY, and st_free_entry.

Referenced by hash_foreach_ensure().

void st_clear ( st_table *  table  ) 
st_table* st_copy ( st_table *  old_table  ) 
int st_delete ( register st_table *  table,
register st_data_t *  key,
st_data_t *  value 
)
int st_delete_safe ( register st_table *  table,
register st_data_t *  key,
st_data_t *  value,
st_data_t  never 
)
int st_foreach ( st_table *  table,
int(*)(ANYARGS)  func,
st_data_t  arg 
)
int st_foreach_check ( st_table *  table,
int(*)(ANYARGS)  func,
st_data_t  arg,
st_data_t  never 
)
void st_free_table ( st_table *  table  ) 
int st_get_key ( st_table *  table,
register st_data_t  key,
st_data_t *  result 
)

Definition at line 442 of file st.c.

References do_hash, find_entry(), find_packed_index(), st_table_entry::key, PKEY, and real_entries.

Referenced by rb_feature_p().

st_index_t st_hash ( const void *  ptr,
size_t  len,
st_index_t  h 
)

Definition at line 1319 of file st.c.

References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, t(), and UNALIGNED_ADD_ALL.

Referenced by hash_i(), and strhash().

st_index_t st_hash_end ( st_index_t  h  ) 

Definition at line 1483 of file st.c.

References murmur_step.

st_index_t st_hash_start ( st_index_t  h  ) 

Definition at line 1492 of file st.c.

References st_hash_start.

st_index_t st_hash_uint ( st_index_t  h,
st_index_t  i 
)

Definition at line 1452 of file st.c.

References murmur1.

st_index_t st_hash_uint32 ( st_index_t  h,
uint32_t  i 
)

Definition at line 1446 of file st.c.

References murmur_step.

st_table* st_init_numtable ( void   ) 
st_table* st_init_numtable_with_size ( st_index_t  size  ) 

Definition at line 278 of file st.c.

References st_init_table_with_size(), and type_numhash.

Referenced by Init_sym().

st_table* st_init_strcasetable ( void   ) 
st_table* st_init_strcasetable_with_size ( st_index_t  size  ) 

Definition at line 302 of file st.c.

References st_init_table_with_size().

st_table* st_init_strtable ( void   ) 

Definition at line 284 of file st.c.

References st_init_table().

Referenced by Init_load(), load_lock(), ruby_init_ext(), and zone_str().

st_table* st_init_strtable_with_size ( st_index_t  size  ) 

Definition at line 290 of file st.c.

References st_init_table_with_size().

st_table* st_init_table ( const struct st_hash_type *  type  ) 

Definition at line 266 of file st.c.

References st_init_table_with_size().

Referenced by rb_hash_tbl(), st_init_numtable(), st_init_strcasetable(), and st_init_strtable().

st_table* st_init_table_with_size ( const struct st_hash_type *  type,
st_index_t  size 
)
int st_insert ( register st_table *  table,
register st_data_t  key,
st_data_t  value 
)
int st_insert2 ( register st_table *  table,
register st_data_t  key,
st_data_t  value,
st_data_t(*)(st_data_t)  func 
)
int st_lookup ( st_table *  table,
register st_data_t  key,
st_data_t *  value 
)

Definition at line 414 of file st.c.

References do_hash, find_entry(), find_packed_index(), PVAL, real_entries, and st_table_entry::record.

Referenced by add_opt_method(), autoload_data(), autoload_defined_p(), autoload_delete(), classname(), constat_handle(), constat_reset(), cv_i(), cvar_lookup_at(), define_final0(), eql_i(), fc_path(), features_index_add_single(), flatten(), generic_ivar_defined(), generic_ivar_get(), generic_ivar_remove(), generic_ivar_set(), get_syserr(), get_transcoder_entry(), iseq_build_from_ary_body(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), ivar_get(), load_lock(), lookup_method_table(), make_transcoder_entry(), method_entry_i(), obj_alloc_by_klass(), ole_vstr2wc(), r_entry0(), r_leave(), r_object0(), r_symlink(), rb_alias_variable(), rb_ary_diff(), rb_autoload(), rb_check_id(), rb_check_id_cstr(), rb_const_defined_0(), rb_const_get_0(), rb_const_set(), rb_copy_generic_ivar(), rb_econv_asciicompat_encoding(), rb_enc_registered(), rb_f_untrace_var(), rb_feature_p(), rb_gc_copy_finalizer(), rb_generic_ivar_memsize(), rb_generic_ivar_table(), rb_global_entry(), rb_hash_aref(), rb_hash_fetch_m(), rb_hash_has_key(), rb_hash_lookup2(), rb_id2str(), rb_intern3(), rb_intern_str(), rb_ivar_count(), rb_ivar_defined(), rb_ivar_foreach(), rb_ivar_set(), rb_mark_generic_ivar(), rb_method_entry_make(), rb_obj_frozen_p(), rb_obj_remove_instance_variable(), rb_thread_key_p(), rb_thread_local_aref(), rb_thread_variable_p(), rb_tmp_class_path(), rb_vm_check_redefinition_opt_method(), register_label(), remove_method(), set_const_visibility(), set_syserr(), socklist_lookup(), sv_i(), syserr_initialize(), transcode_search_path(), transcode_search_path_i(), vm_callee_setup_keyword_arg(), vm_get_ev_const(), vm_getivar(), vm_setivar(), w_class(), w_encoding(), w_object(), w_symbol(), wmap_aref(), and wmap_aset().

size_t st_memsize ( const st_table *  table  ) 
int st_numcmp ( st_data_t  x,
st_data_t  y 
)

Definition at line 1575 of file st.c.

Referenced by STATIC_ASSERT().

st_index_t st_numhash ( st_data_t  n  ) 

Definition at line 1581 of file st.c.

Referenced by STATIC_ASSERT().

static st_table_entry** st_realloc_bins ( st_table_entry **  bins,
st_index_t  newsize,
st_index_t  oldsize 
) [inline, static]

Definition at line 98 of file st.c.

References MEMZERO, and realloc.

Referenced by rehash(), and unpack_entries().

int st_strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 1506 of file st.c.

int st_strncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Definition at line 1530 of file st.c.

int st_update ( st_table *  table,
st_data_t  key,
st_update_callback_func *  func,
st_data_t  arg 
)
STATIC_ASSERT ( st_packed_entry  ,
sizeof(st_packed_entry = = sizeof(st_table_entry*[PACKED_UNIT]) 
)

Definition at line 42 of file st.c.

References st_hashtype_num, st_numcmp(), and st_numhash().

static st_index_t strcasehash ( st_data_t  arg  )  [static]

Definition at line 1555 of file st.c.

References FNV1_32A_INIT, and FNV_32_PRIME.

static st_index_t strhash ( st_data_t  arg  )  [static]

Definition at line 1498 of file st.c.

References FNV1_32A_INIT, st_hash(), and strlen().

static void unpack_entries ( register st_table *  table  )  [static]

Variable Documentation

const unsigned int primes[] [static]

Definition at line 151 of file st.c.

struct st_hash_type type_strcasehash [static]
Initial value:

Definition at line 69 of file st.c.

struct st_hash_type type_strhash [static]
Initial value:
 {
    strcmp,
    strhash,
}

Definition at line 63 of file st.c.


Generated on 18 May 2020 for Ruby by  doxygen 1.6.1