| z, ? | toggle help (this) |
| space, → | next slide |
| shift-space, ← | previous slide |
| d | toggle debug mode |
| ## <ret> | go to slide # |
| r | reload slides |
| n | toggle notes |


def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
def add?(o)
add(o) unless include?(o)
end
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
st_data_t record;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
};
struct st_table_entry {
st_hash_t hash;
st_data_t key;
};
struct set_table_entry {
st_hash_t hash;
st_data_t key;
};
struct st_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
st_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
st_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
set_table_entry *entries;
};
void
st_free_table(st_table *tab)
{
free(tab->bins);
free(tab->entries);
free(tab);
}
void
set_free_table(st_table *tab)
{
free(tab->bins);
free(tab->entries);
free(tab);
}
void
set_free_table(set_table *tab)
{
free(tab->bins);
free(tab->entries);
free(tab);
}
st_index_t
rb_st_values(st_table *table,
st_data_t *values,
st_index_t size);
st_index_t
rb_st_values(st_table *table,
st_data_t *values,
st_index_t size);
static inline int
st_general_foreach(st_table *tab,
st_foreach_check_callback_func *func,
st_update_callback_func *replace,
st_data_t arg, int check_p);
static inline int
st_general_foreach(st_table *tab,
st_foreach_check_callback_func *func,
st_update_callback_func *replace,
st_data_t arg, int check_p);
static inline int
set_general_foreach(set_table *tab,
set_foreach_check_callback_func *func,
set_update_callback_func *replace,
st_data_t arg, int check_p);
hash = curr_entry_ptr->hash;
retval = (*func)(key, curr_entry_ptr->record, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, curr_entry_ptr->record, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
static inline int
set_general_foreach(set_table *tab,
set_foreach_check_callback_func *func,
set_update_callback_func *replace,
st_data_t arg, int check_p);
typedef int
st_foreach_check_callback_func(st_data_t, st_data_t,
st_data_t, int);
typedef int
st_foreach_check_callback_func(st_data_t, st_data_t,
st_data_t, int);
typedef int
set_foreach_check_callback_func(st_data_t,
st_data_t, int);
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
st_data_t value;
value = curr_entry_ptr->record;
retval = (*replace)(&key, &value, arg, TRUE);
curr_entry_ptr->key = key;
curr_entry_ptr->record = value;
}
hash = curr_entry_ptr->hash;
retval = (*func)(key, arg, 0);
if (retval == ST_REPLACE && replace) {
retval = (*replace)(&key, arg, TRUE);
curr_entry_ptr->key = key;
}
def add?(o)
add(o) unless include?(o)
end
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_s_alloc(VALUE klass)
{
return set_alloc_with_size(klass, 0);
}
static VALUE
set_s_alloc(VALUE klass)
{
return set_alloc_with_size(klass, 0);
}
static VALUE
set_s_alloc(VALUE klass)
{
return set_alloc_with_size(klass, 0);
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
struct set_object {
set_table table;
};
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static VALUE
set_alloc_with_size(VALUE klass, st_index_t size)
{
VALUE set;
struct set_object *sobj;
set = TypedData_Make_Struct(klass, struct set_object,
&set_data_type, sobj);
set_init_table_with_size(&sobj->table, &objhash, size);
return set;
}
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
set_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
set_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
set_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
set_table_entry *entries;
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static const rb_data_type_t set_data_type = {
.wrap_struct_name = "set",
.function = {
.dmark = set_mark,
.dfree = set_free,
.dsize = set_size,
.dcompact = set_update_references,
},
.flags = RUBY_TYPED_EMBEDDABLE |
RUBY_TYPED_FREE_IMMEDIATELY |
RUBY_TYPED_WB_PROTECTED |
RUBY_TYPED_FROZEN_SHAREABLE
};
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static VALUE
set_i_add_p(VALUE set, VALUE item)
{
rb_check_frozen(set);
if (set_iterating_p(set)) {
if (!set_table_lookup(RSET_TABLE(set), (st_data_t)item)) {
no_new_item();
}
return Qnil;
}
else {
return set_insert_wb(set, item, NULL) ? Qnil : set;
}
}
static int
set_insert_wb(VALUE set, VALUE key, VALUE *key_addr)
{
return set_table_insert_wb(RSET_TABLE(set), set,
key, key_addr);
}
static int
set_insert_wb(VALUE set, VALUE key, VALUE *key_addr)
{
return set_table_insert_wb(RSET_TABLE(set), set,
key, key_addr);
}
static int
set_insert_wb(VALUE set, VALUE key, VALUE *key_addr)
{
return set_table_insert_wb(RSET_TABLE(set), set,
key, key_addr);
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static VALUE
set_i_initialize_copy(VALUE set, VALUE other)
{
if (set == other) return set;
if (set_iterating_p(set)) {
rb_raise(rb_eRuntimeError, "cannot replace set during iteration");
}
struct set_object *sobj;
TypedData_Get_Struct(set, struct set_object, &set_data_type, sobj);
set_free_embedded_table(&sobj->table);
set_copy(&sobj->table, RSET_TABLE(other));
return set;
}
static VALUE
set_i_initialize_copy(VALUE set, VALUE other)
{
if (set == other) return set;
if (set_iterating_p(set)) {
rb_raise(rb_eRuntimeError, "cannot replace set during iteration");
}
struct set_object *sobj;
TypedData_Get_Struct(set, struct set_object, &set_data_type, sobj);
set_free_embedded_table(&sobj->table);
set_copy(&sobj->table, RSET_TABLE(other));
return set;
}
static VALUE
set_i_initialize_copy(VALUE set, VALUE other)
{
if (set == other) return set;
if (set_iterating_p(set)) {
rb_raise(rb_eRuntimeError, "cannot replace set during iteration");
}
struct set_object *sobj;
TypedData_Get_Struct(set, struct set_object, &set_data_type, sobj);
set_free_embedded_table(&sobj->table);
set_copy(&sobj->table, RSET_TABLE(other));
rb_gc_writebarrier_remember(set);
return set;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key, VALUE *key_addr)
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
if (key_addr) *key_addr = key;
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
static int
set_table_insert_wb(set_table *tab, VALUE set,
VALUE key )
{
if (tab->type != &identhash &&
rb_obj_class(key) == rb_cString &&
!RB_OBJ_FROZEN(key)) {
key = rb_hash_key_str(key);
}
int ret = set_insert(tab, (st_data_t)key);
if (ret == 0) RB_OBJ_WRITTEN(set, Qundef, key);
return ret;
}
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
class Set
module SubclassCompatible
module ClassMethods
def [](*ary)
new(ary)
end
end
end
end
class Set
module SubclassCompatible
module ClassMethods
def [](*ary)
new(ary)
end
end
end
end
class Set
module SubclassCompatible
module ClassMethods
def [](*ary)
new(ary)
end
end
end
end
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
Set::CoreSet = Class.new(Set)
def Set.inherited(subclass)
if self == Set
subclass.include SubclassCompatible
subclass.extend SubclassCompatible::ClassMethods
end
end
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
const VALUE typed_flag;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
const VALUE typed_flag;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
const VALUE typed_flag;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
const VALUE typed_flag;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
const VALUE typed_flag;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RData {
struct RBasic basic;
RUBY_DATA_FUNC dmark;
void *data;
RUBY_DATA_FUNC dfree;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RData {
struct RBasic basic;
RUBY_DATA_FUNC dmark;
void *data;
RUBY_DATA_FUNC dfree;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RData {
struct RBasic basic;
RUBY_DATA_FUNC dmark;
void *data;
RUBY_DATA_FUNC dfree;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RData {
struct RBasic basic;
RUBY_DATA_FUNC dmark;
void *data;
RUBY_DATA_FUNC dfree;
}
struct RTypedData {
struct RBasic basic;
const rb_data_type_t *const type;
void *data;
}
struct RData {
struct RBasic basic;
RUBY_DATA_FUNC dmark;
void *data;
RUBY_DATA_FUNC dfree;
}
struct RTypedData {
struct RBasic basic;
VALUE fields_obj;
const rb_data_type_t *const type;
void *data;
}
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t *bins;
st_index_t entries_start, entries_bound;
st_table_entry *entries;
};
struct set_table {
unsigned char entry_power, bin_power, size_ind;
unsigned int rebuilds_num;
const struct st_hash_type *type;
st_index_t num_entries;
st_index_t entries_start, entries_bound;
st_table_entry *entries;
};
