Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created August 29, 2009 23:54
Show Gist options
  • Select an option

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

Select an option

Save methodmissing/177776 to your computer and use it in GitHub Desktop.
static struct st_hash_type objstrhash = {
rb_strhash_hash_cmp,
rb_strhash_hash,
};
static VALUE
strhash_alloc(VALUE klass)
{
VALUE hash = strhash_alloc0(&klass);
HASH_TBL(hash) = st_init_table(&objstrhash);
return hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment