Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Data Structures | |
struct | list_id_table |
struct | rb_id_item |
struct | hash_id_table |
struct | mix_id_table |
Macros | |
#define | ID_TABLE_DEBUG 0 |
#define | NDEBUG |
#define | ID_TABLE_IMPL 34 |
#define | ID_TABLE_NAME mix |
#define | ID_TABLE_IMPL_TYPE struct mix_id_table |
#define | ID_TABLE_USE_MIX 1 |
#define | ID_TABLE_USE_MIX_LIST_MAX_CAPA 64 |
#define | ID_TABLE_USE_ID_SERIAL 1 |
#define | ID_TABLE_USE_LIST 1 |
#define | ID_TABLE_USE_CALC_VALUES 1 |
#define | ID_TABLE_USE_LIST_SORTED 1 |
#define | ID_TABLE_USE_SMALL_HASH 1 |
#define | IMPL1(name, op) TOKEN_PASTE(name, _id##op) /* expand `name' */ |
#define | IMPL(op) IMPL1(ID_TABLE_NAME, _table##op) /* but prevent `op' */ |
#define | UNUSED(func) static func |
#define | LIST_MIN_CAPA 4 |
#define | TABLE_VALUES(tbl) ((VALUE *)((tbl)->keys + (tbl)->capa)) |
#define | FOREACH_LAST() |
#define | ITEM_GET_KEY(tbl, i) ((tbl)->items[i].key >> 1) |
#define | ITEM_KEY_ISSET(tbl, i) ((tbl)->items[i].key > 1) |
#define | ITEM_COLLIDED(tbl, i) ((tbl)->items[i].key & 1) |
#define | ITEM_SET_COLLIDED(tbl, i) ((tbl)->items[i].key |= 1) |
#define | LIST_LIMIT_P(mix) ((mix)->aux.size.num == ID_TABLE_USE_MIX_LIST_MAX_CAPA) |
#define | LIST_P(mix) ((mix)->aux.size.capa <= ID_TABLE_USE_MIX_LIST_MAX_CAPA) |
#define | IMPL_TYPE1(type, prot, name, args) RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) |
#define | IMPL_TYPE(type, name, prot, args) IMPL_TYPE1(type, rb_id_table_##name prot, IMPL(_##name), args) |
#define | IMPL_VOID1(prot, name, args) RUBY_ALIAS_FUNCTION_VOID(prot, name, args) |
#define | IMPL_VOID(name, prot, args) IMPL_VOID1(rb_id_table_##name prot, IMPL(_##name), args) |
#define | id_tbl (ID_TABLE_IMPL_TYPE *)tbl |
Typedefs | |
typedef rb_id_serial_t | id_key_t |
typedef struct rb_id_item | item_t |
#define FOREACH_LAST | ( | ) |
Definition at line 721 of file id_table.c.
Referenced by list_id_table_foreach(), and list_id_table_foreach_values().
#define ID_TABLE_DEBUG 0 |
Definition at line 6 of file id_table.c.
#define ID_TABLE_IMPL 34 |
Definition at line 36 of file id_table.c.
#define ID_TABLE_IMPL_TYPE struct mix_id_table |
Definition at line 153 of file id_table.c.
#define ID_TABLE_NAME mix |
Definition at line 152 of file id_table.c.
#define ID_TABLE_USE_CALC_VALUES 1 |
Definition at line 161 of file id_table.c.
#define ID_TABLE_USE_ID_SERIAL 1 |
Definition at line 158 of file id_table.c.
#define ID_TABLE_USE_LIST 1 |
Definition at line 160 of file id_table.c.
#define ID_TABLE_USE_LIST_SORTED 1 |
Definition at line 162 of file id_table.c.
#define ID_TABLE_USE_MIX 1 |
Definition at line 155 of file id_table.c.
#define ID_TABLE_USE_MIX_LIST_MAX_CAPA 64 |
Definition at line 156 of file id_table.c.
#define ID_TABLE_USE_SMALL_HASH 1 |
Definition at line 164 of file id_table.c.
#define id_tbl (ID_TABLE_IMPL_TYPE *)tbl |
Definition at line 1563 of file id_table.c.
#define IMPL | ( | op | ) | IMPL1(ID_TABLE_NAME, _table##op) /* but prevent `op' */ |
Definition at line 192 of file id_table.c.
#define IMPL1 | ( | name, | |
op | |||
) | TOKEN_PASTE(name, _id##op) /* expand `name' */ |
Definition at line 191 of file id_table.c.
#define IMPL_TYPE | ( | type, | |
name, | |||
prot, | |||
args | |||
) | IMPL_TYPE1(type, rb_id_table_##name prot, IMPL(_##name), args) |
Definition at line 1557 of file id_table.c.
#define IMPL_TYPE1 | ( | type, | |
prot, | |||
name, | |||
args | |||
) | RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) |
Definition at line 1555 of file id_table.c.
Definition at line 1561 of file id_table.c.
#define IMPL_VOID1 | ( | prot, | |
name, | |||
args | |||
) | RUBY_ALIAS_FUNCTION_VOID(prot, name, args) |
Definition at line 1559 of file id_table.c.
#define ITEM_COLLIDED | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key & 1) |
Definition at line 1182 of file id_table.c.
Referenced by hash_delete_index(), hash_table_index(), hash_table_raw_insert(), and ITEM_SET_KEY().
#define ITEM_GET_KEY | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key >> 1) |
Definition at line 1180 of file id_table.c.
Referenced by hash_id_table_foreach(), hash_table_extend(), and hash_table_index().
#define ITEM_KEY_ISSET | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key > 1) |
Definition at line 1181 of file id_table.c.
Referenced by hash_id_table_foreach(), hash_id_table_foreach_values(), hash_table_extend(), and hash_table_raw_insert().
#define ITEM_SET_COLLIDED | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key |= 1) |
Definition at line 1183 of file id_table.c.
Referenced by hash_table_raw_insert().
#define LIST_LIMIT_P | ( | mix | ) | ((mix)->aux.size.num == ID_TABLE_USE_MIX_LIST_MAX_CAPA) |
Definition at line 1442 of file id_table.c.
Referenced by mix_id_table_insert().
#define LIST_MIN_CAPA 4 |
Definition at line 361 of file id_table.c.
Referenced by list_table_extend().
#define LIST_P | ( | mix | ) | ((mix)->aux.size.capa <= ID_TABLE_USE_MIX_LIST_MAX_CAPA) |
Definition at line 1443 of file id_table.c.
Referenced by mix_id_table_clear(), mix_id_table_delete(), mix_id_table_foreach(), mix_id_table_foreach_values(), mix_id_table_free(), mix_id_table_insert(), mix_id_table_lookup(), mix_id_table_memsize(), and mix_id_table_size().
#define NDEBUG |
Definition at line 10 of file id_table.c.
#define TABLE_VALUES | ( | tbl | ) | ((VALUE *)((tbl)->keys + (tbl)->capa)) |
Definition at line 373 of file id_table.c.
Referenced by list_delete_index(), list_id_table_foreach(), list_id_table_foreach_values(), list_id_table_insert(), list_id_table_lookup(), and mix_id_table_insert().
Definition at line 197 of file id_table.c.
typedef rb_id_serial_t id_key_t |
Definition at line 212 of file id_table.c.
typedef struct rb_id_item item_t |
|
static |
Definition at line 1291 of file id_table.c.
References FALSE, ITEM_COLLIDED, ITEM_SET_KEY(), hash_id_table::items, hash_id_table::num, TRUE, hash_id_table::used, and rb_id_item::val.
Referenced by hash_id_table_delete(), hash_id_table_foreach(), and hash_id_table_foreach_values().
|
static |
Definition at line 1233 of file id_table.c.
References hash_id_table::capa, hash_id_table::items, MEMZERO, hash_id_table::num, and hash_id_table::used.
Referenced by list_id_table_foreach_values(), and mix_id_table_clear().
|
static |
Definition at line 1385 of file id_table.c.
References hash_delete_index(), hash_table_index(), and id2key().
Referenced by list_id_table_foreach_values(), and mix_id_table_delete().
|
static |
Definition at line 1393 of file id_table.c.
References assert, hash_id_table::capa, hash_delete_index(), ID_TABLE_DELETE, ID_TABLE_STOP, ITEM_GET_KEY, ITEM_KEY_ISSET, hash_id_table::items, key2id(), and rb_id_item::val.
Referenced by list_id_table_foreach_values(), and mix_id_table_foreach().
|
static |
Definition at line 1412 of file id_table.c.
References hash_id_table::capa, hash_delete_index(), ID_TABLE_DELETE, ID_TABLE_STOP, ITEM_KEY_ISSET, hash_id_table::items, and rb_id_item::val.
Referenced by list_id_table_foreach_values(), and mix_id_table_foreach_values().
|
static |
Definition at line 1226 of file id_table.c.
References hash_id_table::items, and xfree().
Referenced by list_id_table_foreach_values(), and mix_id_table_free().
|
static |
Definition at line 1205 of file id_table.c.
References ALLOC, hash_id_table::capa, hash_id_table::items, MEMZERO, round_capa(), and ZALLOC_N.
Referenced by mix_id_table_insert().
|
static |
Definition at line 1379 of file id_table.c.
References hash_id_table_insert_key(), and id2key().
Referenced by list_id_table_foreach_values(), and mix_id_table_insert().
|
static |
Definition at line 1364 of file id_table.c.
References hash_table_extend(), hash_table_index(), hash_table_raw_insert(), hash_id_table::items, TRUE, rb_id_item::val, and val.
Referenced by hash_id_table_insert(), and mix_id_table_insert().
|
static |
Definition at line 1349 of file id_table.c.
References FALSE, hash_table_index(), id2key(), hash_id_table::items, TRUE, and rb_id_item::val.
Referenced by list_id_table_foreach_values(), and mix_id_table_lookup().
|
static |
Definition at line 1247 of file id_table.c.
References hash_id_table::capa.
Referenced by list_id_table_foreach_values(), and mix_id_table_memsize().
|
static |
Definition at line 1241 of file id_table.c.
References hash_id_table::num.
Referenced by list_id_table_foreach_values(), and mix_id_table_size().
|
static |
Definition at line 1307 of file id_table.c.
References hash_id_table::capa, hash_table_raw_insert(), ITEM_GET_KEY, ITEM_KEY_ISSET, hash_id_table::items, key2id(), hash_id_table::num, rb_id2name(), round_capa(), hash_id_table::used, rb_id_item::val, xfree(), and ZALLOC_N.
Referenced by hash_id_table_insert_key().
|
static |
Definition at line 1253 of file id_table.c.
References hash_id_table::capa, ITEM_COLLIDED, and ITEM_GET_KEY.
Referenced by hash_id_table_delete(), hash_id_table_insert_key(), and hash_id_table_lookup().
|
static |
Definition at line 1271 of file id_table.c.
References assert, hash_id_table::capa, ITEM_COLLIDED, ITEM_KEY_ISSET, ITEM_SET_COLLIDED, ITEM_SET_KEY(), hash_id_table::items, hash_id_table::num, hash_id_table::used, rb_id_item::val, and val.
Referenced by hash_id_table_insert_key(), and hash_table_extend().
Definition at line 220 of file id_table.c.
References ALLOC, ANYARGS, func, key, NULL, rb_bug(), rb_id_table_foreach_func_t(), rb_id_table_foreach_values_func_t(), rb_id_to_serial(), return, size, st_clear(), st_data_t, st_delete, st_foreach, st_free_table, st_init_numtable_with_size, st_insert, st_lookup, st_memsize(), val, values_i(), and xfree().
Referenced by hash_id_table_delete(), hash_id_table_insert(), hash_id_table_lookup(), list_id_table_delete(), list_id_table_foreach_values(), list_id_table_insert(), and list_id_table_lookup().
|
inlinestatic |
Definition at line 1185 of file id_table.c.
References ITEM_COLLIDED, hash_id_table::items, and rb_id_item::key.
Referenced by hash_delete_index(), and hash_table_raw_insert().
Definition at line 214 of file id_table.c.
References rb_id_serial_to_id().
Referenced by hash_id_table_foreach(), hash_table_extend(), list_id_table_foreach(), list_id_table_foreach_values(), and list_table_extend().
|
static |
Definition at line 685 of file id_table.c.
References FALSE, list_id_table::keys, list_id_table::num, TABLE_VALUES, tbl_assert(), and TRUE.
Referenced by list_id_table_delete().
|
static |
Definition at line 421 of file id_table.c.
References list_id_table::num.
Referenced by mix_id_table_clear().
|
static |
Definition at line 714 of file id_table.c.
References id2key(), list_delete_index(), and list_table_index().
Referenced by mix_id_table_delete().
|
static |
Definition at line 737 of file id_table.c.
References assert, FOREACH_LAST, ID_TABLE_STOP, key2id(), list_id_table::keys, list_id_table::num, and TABLE_VALUES.
Referenced by mix_id_table_foreach().
|
static |
Definition at line 755 of file id_table.c.
References ANYARGS, assert, FOREACH_LAST, hash_id_table_clear(), hash_id_table_delete(), hash_id_table_foreach(), hash_id_table_foreach_values(), hash_id_table_free(), hash_id_table_insert(), hash_id_table_lookup(), hash_id_table_memsize(), hash_id_table_size(), id2key(), ID_TABLE_DELETE, ID_TABLE_STOP, key, key2id(), list_id_table::keys, list_id_table::num, rb_warn(), st_data_t, TABLE_VALUES, val, xfree(), ZALLOC, and ZALLOC_N.
Referenced by mix_id_table_foreach_values().
|
static |
Definition at line 411 of file id_table.c.
References list_id_table::keys, and xfree().
Referenced by mix_id_table_free().
|
static |
Definition at line 379 of file id_table.c.
References ALLOC_N, list_id_table::capa, list_id_table::keys, xmalloc, and ZALLOC.
Referenced by mix_id_table_create().
|
static |
Definition at line 646 of file id_table.c.
References id2key(), key, list_id_table::keys, list_table_extend(), list_table_index(), list_id_table::num, TABLE_VALUES, tbl_assert(), TRUE, and val.
Referenced by mix_id_table_insert().
|
static |
Definition at line 619 of file id_table.c.
References FALSE, id2key(), list_id_table::keys, list_table_index(), TABLE_VALUES, and TRUE.
Referenced by mix_id_table_lookup().
|
static |
Definition at line 433 of file id_table.c.
References list_id_table::capa.
Referenced by mix_id_table_memsize().
|
static |
Definition at line 427 of file id_table.c.
References list_id_table::num.
Referenced by mix_id_table_size().
Definition at line 548 of file id_table.c.
References assert, key, max(), and list_id_table::num.
Referenced by list_table_index().
|
static |
Definition at line 439 of file id_table.c.
References ALLOC_N, assert, list_id_table::capa, key2id(), list_id_table::keys, LIST_MIN_CAPA, NULL, list_id_table::num, rb_id2name(), xfree(), and xrealloc.
Referenced by list_id_table_insert().
|
static |
Definition at line 597 of file id_table.c.
References assert, list_id_table::keys, list_ids_bsearch(), and list_id_table::num.
Referenced by list_id_table_delete(), list_id_table_insert(), and list_id_table_lookup().
|
static |
Definition at line 1461 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_clear(), mix_id_table::list, list_id_table_clear(), and LIST_P.
|
static |
Definition at line 1446 of file id_table.c.
References list_id_table_init(), and ZALLOC.
|
static |
Definition at line 1533 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_delete(), mix_id_table::list, list_id_table_delete(), and LIST_P.
|
static |
Definition at line 1540 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_foreach(), mix_id_table::list, list_id_table_foreach(), and LIST_P.
|
static |
Definition at line 1547 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_foreach_values(), mix_id_table::list, list_id_table_foreach_values(), and LIST_P.
|
static |
Definition at line 1454 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_free(), mix_id_table::list, list_id_table_free(), and LIST_P.
|
static |
Definition at line 1482 of file id_table.c.
References assert, mix_id_table::aux, mix_id_table::hash, hash_id_table_init(), hash_id_table_insert(), hash_id_table_insert_key(), list_id_table::keys, list, mix_id_table::list, list_id_table_insert(), LIST_LIMIT_P, LIST_P, list_id_table::num, hash_id_table::num, TABLE_VALUES, and xfree().
|
static |
Definition at line 1526 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_lookup(), mix_id_table::list, list_id_table_lookup(), and LIST_P.
|
static |
Definition at line 1475 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_memsize(), mix_id_table::list, list_id_table_memsize(), and LIST_P.
|
static |
Definition at line 1468 of file id_table.c.
References mix_id_table::aux, mix_id_table::hash, hash_id_table_size(), mix_id_table::list, list_id_table_size(), and LIST_P.
|
inlinestatic |
Definition at line 1192 of file id_table.c.
Referenced by hash_id_table_init(), and hash_table_extend().
|
static |
Definition at line 528 of file id_table.c.
References list_id_table::keys, list_id_table::num, and rb_bug().
Referenced by list_delete_index(), and list_id_table_insert().
UNUSED | ( | ID_TABLE_IMPL_TYPE * | IMPL_create)(size_t | ) |
UNUSED | ( | void | IMPL_free)(ID_TABLE_IMPL_TYPE * | ) |
UNUSED | ( | void | IMPL_clear)(ID_TABLE_IMPL_TYPE * | ) |
UNUSED | ( | size_t | IMPL_size)(const ID_TABLE_IMPL_TYPE * | ) |
UNUSED | ( | size_t | IMPL_memsize)(const ID_TABLE_IMPL_TYPE * | ) |
UNUSED | ( | int | IMPL_insert)(ID_TABLE_IMPL_TYPE *, ID, VALUE | ) |
UNUSED | ( | int | IMPL_lookup)(ID_TABLE_IMPL_TYPE *, ID, VALUE * | ) |
UNUSED | ( | int | IMPL_delete)(ID_TABLE_IMPL_TYPE *, ID | ) |
UNUSED | ( | void | IMPL_foreach)(ID_TABLE_IMPL_TYPE *, rb_id_table_foreach_func_t *, void * | ) |
UNUSED | ( | void | IMPL_foreach_values)(ID_TABLE_IMPL_TYPE *, rb_id_table_foreach_values_func_t *, void * | ) |