Ruby
2.5.0dev(2017-10-22revision60238)
|
Go to the source code of this file.
Data Structures | |
struct | rb_id_item |
struct | rb_id_table |
Macros | |
#define | ID_TABLE_DEBUG 0 |
#define | NDEBUG |
#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) |
Typedefs | |
typedef rb_id_serial_t | id_key_t |
typedef struct rb_id_item | item_t |
Functions | |
struct rb_id_table * | rb_id_table_create (size_t capa) |
void | rb_id_table_free (struct rb_id_table *tbl) |
void | rb_id_table_clear (struct rb_id_table *tbl) |
size_t | rb_id_table_size (const struct rb_id_table *tbl) |
size_t | rb_id_table_memsize (const struct rb_id_table *tbl) |
int | rb_id_table_lookup (struct rb_id_table *tbl, ID id, VALUE *valp) |
int | rb_id_table_insert (struct rb_id_table *tbl, ID id, VALUE val) |
int | rb_id_table_delete (struct rb_id_table *tbl, ID id) |
void | rb_id_table_foreach (struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data) |
void | rb_id_table_foreach_values (struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data) |
#define ID_TABLE_DEBUG 0 |
Definition at line 6 of file id_table.c.
#define ITEM_COLLIDED | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key & 1) |
Definition at line 60 of file id_table.c.
#define ITEM_GET_KEY | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key >> 1) |
Definition at line 58 of file id_table.c.
Referenced by rb_id_table_foreach().
#define ITEM_KEY_ISSET | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key > 1) |
Definition at line 59 of file id_table.c.
Referenced by rb_id_table_foreach(), and rb_id_table_foreach_values().
#define ITEM_SET_COLLIDED | ( | tbl, | |
i | |||
) | ((tbl)->items[i].key |= 1) |
Definition at line 61 of file id_table.c.
#define NDEBUG |
Definition at line 10 of file id_table.c.
typedef rb_id_serial_t id_key_t |
Definition at line 14 of file id_table.c.
typedef struct rb_id_item item_t |
void rb_id_table_clear | ( | struct rb_id_table * | tbl | ) |
Definition at line 109 of file id_table.c.
References rb_id_table::capa, rb_id_table::items, MEMZERO, rb_id_table::num, and rb_id_table::used.
struct rb_id_table* rb_id_table_create | ( | size_t | capa | ) |
int rb_id_table_delete | ( | struct rb_id_table * | tbl, |
ID | id | ||
) |
Definition at line 262 of file id_table.c.
References rb_id_item::key.
Referenced by rb_const_remove().
void rb_id_table_foreach | ( | struct rb_id_table * | tbl, |
rb_id_table_foreach_func_t * | func, | ||
void * | data | ||
) |
Definition at line 270 of file id_table.c.
References rb_id_table::capa, ITEM_GET_KEY, ITEM_KEY_ISSET, and rb_id_item::key.
Referenced by rb_f_global_variables(), rb_mod_const_at(), rb_obj_singleton_methods(), and rb_undef_methods_from().
void rb_id_table_foreach_values | ( | struct rb_id_table * | tbl, |
rb_id_table_foreach_values_func_t * | func, | ||
void * | data | ||
) |
Definition at line 289 of file id_table.c.
References rb_id_table::capa, ID_TABLE_DELETE, ITEM_KEY_ISSET, rb_id_table::items, and rb_id_item::val.
Referenced by rb_free_const_table(), and rb_gc_mark_global_tbl().
void rb_id_table_free | ( | struct rb_id_table * | tbl | ) |
Definition at line 102 of file id_table.c.
References rb_id_table::items, and xfree().
int rb_id_table_insert | ( | struct rb_id_table * | tbl, |
ID | id, | ||
VALUE | val | ||
) |
Definition at line 256 of file id_table.c.
Referenced by rb_alias_variable(), and rb_global_entry().
int rb_id_table_lookup | ( | struct rb_id_table * | tbl, |
ID | id, | ||
VALUE * | valp | ||
) |
Definition at line 226 of file id_table.c.
References rb_id_item::key.
Referenced by rb_alias_variable(), rb_const_lookup(), rb_f_untrace_var(), and rb_global_entry().
size_t rb_id_table_memsize | ( | const struct rb_id_table * | tbl | ) |
Definition at line 123 of file id_table.c.
References rb_id_table::capa.
size_t rb_id_table_size | ( | const struct rb_id_table * | tbl | ) |
Definition at line 117 of file id_table.c.
References rb_id_table::num.
Referenced by rb_class_has_methods().