ext/iodine/fiobj_hash.c
/**
 * Creates a mutable empty Hash object with an initial capacity of `capa`. Use
 * `fiobj_free` when done.
 *
 * Notice that these Hash objects are designed for smaller collections and
 * retain order of object insertion.
 */
Creates a mutable empty Hash object with an initial capacity of `capa`. Use
`fiobj_free` when done.

Notice that these Hash objects are designed for smaller collections and
retain order of object insertion.
Creates a mutable empty Hash object with an initial capacity of ` capa ` . Use ` fiobj_free ` when done . Notice that these Hash objects are designed for smaller collections and retain order of object insertion .
FIOBJ fiobj_hash_new2(size_t capa) {
  fiobj_hash_s *h = fio_malloc(sizeof(*h));
  FIO_ASSERT_ALLOC(h);
  *h = (fiobj_hash_s){.head = {.ref = 1, .type = FIOBJ_T_HASH},
                      .hash = FIO_SET_INIT};
  fio_hash___capa_require(&h->hash, capa);
  return (FIOBJ)h | FIOBJECT_HASH_FLAG;
}
FIOBJ fiobj_hash_new2 ( size_t capa ) { fiobj_hash_s * h = fio_malloc ( sizeof ( * h ) ) ; FIO_ASSERT_ALLOC ( h ) ; * h = ( fiobj_hash_s ) { . head = { . ref = 1 , . type = FIOBJ_T_HASH } , . hash = FIO_SET_INIT } ; fio_hash___capa_require ( & h -> hash , capa ) ; return ( FIOBJ ) h | FIOBJECT_HASH_FLAG ; }
Creates a mutable empty Hash object with an initial capacity of `capa`.
Creates a mutable empty Hash object with an initial capacity of ` capa ` .