diff options
author | svn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 22:12:12 +0000 |
---|---|---|
committer | svn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 22:12:12 +0000 |
commit | d4f1187d31ee300c502713587a26ca186c8e04b9 (patch) | |
tree | 3091b9e385efe1c6ff8036924ba1837aeff7d0ef | |
parent | 8f675cdd00e2c5b5a0f143f5e508dbbafdb20ccd (diff) |
* remove trailing spaces, expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | array.c | 8 | ||||
-rw-r--r-- | class.c | 2 | ||||
-rw-r--r-- | compile.c | 2 | ||||
-rw-r--r-- | gc.c | 10 | ||||
-rw-r--r-- | hash.c | 264 | ||||
-rw-r--r-- | internal.h | 4 | ||||
-rw-r--r-- | marshal.c | 2 | ||||
-rw-r--r-- | transient_heap.c | 16 | ||||
-rw-r--r-- | vm_insnhelper.c | 2 |
9 files changed, 155 insertions, 155 deletions
@@ -4421,9 +4421,9 @@ ary_recycle_hash(VALUE hash) { assert(RBASIC_CLASS(hash) == 0); if (RHASH_TABLE_P(hash)) { - st_table *tbl = RHASH_ST_TABLE(hash); + st_table *tbl = RHASH_ST_TABLE(hash); st_free_table(tbl); - RHASH_CLEAR(hash); + RHASH_CLEAR(hash); } } @@ -4467,7 +4467,7 @@ rb_ary_diff(VALUE ary1, VALUE ary2) hash = ary_make_hash(ary2); for (i=0; i<RARRAY_LEN(ary1); i++) { - if (rb_hash_stlike_lookup(hash, RARRAY_AREF(ary1, i), NULL)) continue; + if (rb_hash_stlike_lookup(hash, RARRAY_AREF(ary1, i), NULL)) continue; rb_ary_push(ary3, rb_ary_elt(ary1, i)); } ary_recycle_hash(hash); @@ -4573,7 +4573,7 @@ rb_ary_and(VALUE ary1, VALUE ary2) for (i=0; i<RARRAY_LEN(ary1); i++) { v = RARRAY_AREF(ary1, i); vv = (st_data_t)v; - if (rb_hash_stlike_delete(hash, &vv, 0)) { + if (rb_hash_stlike_delete(hash, &vv, 0)) { rb_ary_push(ary3, v); } } @@ -1807,7 +1807,7 @@ unknown_keyword_error(VALUE hash, const ID *table, int keywords) int i; for (i = 0; i < keywords; i++) { st_data_t key = ID2SYM(table[i]); - rb_hash_stlike_delete(hash, &key, NULL); + rb_hash_stlike_delete(hash, &key, NULL); } rb_keyword_error("unknown", rb_hash_keys(hash)); } @@ -7990,7 +7990,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, int i; VALUE map = rb_hash_new_with_size(RARRAY_LEN(op)/2); - RHASH_TBL_RAW(map)->type = &cdhash_type; + RHASH_TBL_RAW(map)->type = &cdhash_type; op = rb_to_array_type(op); for (i=0; i<RARRAY_LEN(op); i+=2) { VALUE key = RARRAY_AREF(op, i); @@ -3358,12 +3358,12 @@ obj_memsize_of(VALUE obj, int use_all_types) break; case T_HASH: if (RHASH_ARRAY_P(obj)) { - size += sizeof(li_table); + size += sizeof(li_table); } - else { + else { VM_ASSERT(RHASH_ST_TABLE(obj) != NULL); - size += st_memsize(RHASH_ST_TABLE(obj)); - } + size += st_memsize(RHASH_ST_TABLE(obj)); + } break; case T_REGEXP: if (RREGEXP_PTR(obj)) { @@ -4739,7 +4739,7 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj) break; case T_HASH: - mark_hash(objspace, obj); + mark_hash(objspace, obj); break; case T_STRING: @@ -382,7 +382,7 @@ rb_hash_dump(VALUE hash) for (i=0; i<bound; i++) { li_table_entry *cur_entry = RHASH_ARRAY_REF(hash, i); st_data_t k, v; - + if (!empty_entry(cur_entry)) { char b1[0x100], b2[0x100]; /* h = cur_entry->hash; */ @@ -435,7 +435,7 @@ hash_verify_(VALUE hash, const char *file, int line) if (RHASH_TRANSIENT_P(hash)) { volatile st_data_t MAYBE_UNUSED(key) = RHASH_ARRAY_REF(hash, 0)->key; /* read */ - HASH_ASSERT(RHASH_ARRAY(hash) != NULL); + HASH_ASSERT(RHASH_ARRAY(hash) != NULL); HASH_ASSERT(rb_transient_heap_managed_ptr_p(RHASH_ARRAY(hash))); } return hash; @@ -544,11 +544,11 @@ linear_init_table(VALUE hash) tab = (li_table*)rb_transient_heap_alloc(hash, sizeof(li_table)); if (tab != NULL) { - RHASH_SET_TRANSIENT_FLAG(hash); + RHASH_SET_TRANSIENT_FLAG(hash); } else { - RHASH_UNSET_TRANSIENT_FLAG(hash); - tab = (li_table*)ruby_xmalloc(sizeof(li_table)); + RHASH_UNSET_TRANSIENT_FLAG(hash); + tab = (li_table*)ruby_xmalloc(sizeof(li_table)); } RHASH_ARRAY_SIZE_SET(hash, 0); @@ -580,7 +580,7 @@ linear_free_and_clear_table(VALUE hash) if (tab) { if (RHASH_TRANSIENT_P(hash)) { RHASH_UNSET_TRANSIENT_FLAG(hash); - } + } else { ruby_xfree(RHASH_ARRAY(hash)); } @@ -642,11 +642,11 @@ linear_force_convert_table(VALUE hash, const char *file, int line) for (i = 0; i < bound; i++) { entry = RHASH_ARRAY_REF(hash, i); - if (empty_entry(entry)) continue; + if (empty_entry(entry)) continue; st_add_direct_with_hash(new_tab, entry->key, entry->record, entry->hash); } - linear_free_and_clear_table(hash); + linear_free_and_clear_table(hash); } else { new_tab = st_init_table(&objhash); @@ -660,7 +660,7 @@ static li_table * hash_ltbl(VALUE hash) { if (RHASH_TABLE_EMPTY(hash)) { - linear_init_table(hash); + linear_init_table(hash); } return RHASH_ARRAY(hash); } @@ -711,7 +711,7 @@ linear_add_direct_with_hash(VALUE hash, st_data_t key, st_data_t val, st_hash_t li_table_entry *entry; if (RHASH_ARRAY_SIZE(hash) >= RHASH_ARRAY_MAX_SIZE) { - return 1; + return 1; } else { if (UNLIKELY(bin >= RHASH_ARRAY_MAX_BOUND)) { @@ -808,7 +808,7 @@ linear_foreach_check(VALUE hash, int (*func)(ANYARGS), st_data_t arg, static int linear_update(VALUE hash, st_data_t key, - st_update_callback_func *func, st_data_t arg) + st_update_callback_func *func, st_data_t arg) { int retval, existing; uint8_t bin; @@ -910,7 +910,7 @@ linear_delete(VALUE hash, st_data_t *key, st_data_t *value) { st_index_t bin; st_hash_t hash_value = do_hash(*key); - + bin = find_entry(hash, hash_value, *key); @@ -1035,25 +1035,25 @@ void rb_hash_transient_heap_evacuate(VALUE hash, int promote) { if (RHASH_TRANSIENT_P(hash)) { - li_table *new_tab; - li_table *old_tab = RHASH_ARRAY(hash); + li_table *new_tab; + li_table *old_tab = RHASH_ARRAY(hash); if (UNLIKELY(old_tab == NULL)) { - rb_gc_force_recycle(hash); - return; - } - HASH_ASSERT(old_tab != NULL); - if (promote) { + rb_gc_force_recycle(hash); + return; + } + HASH_ASSERT(old_tab != NULL); + if (promote) { promote: - new_tab = ruby_xmalloc(sizeof(li_table)); - RHASH_UNSET_TRANSIENT_FLAG(hash); - } - else { - new_tab = rb_transient_heap_alloc(hash, sizeof(li_table)); + new_tab = ruby_xmalloc(sizeof(li_table)); + RHASH_UNSET_TRANSIENT_FLAG(hash); + } + else { + new_tab = rb_transient_heap_alloc(hash, sizeof(li_table)); if (new_tab == NULL) goto promote; - } - *new_tab = *old_tab; - RHASH_ARRAY_SET(hash, new_tab); + } + *new_tab = *old_tab; + RHASH_ARRAY_SET(hash, new_tab); } hash_verify(hash); } @@ -1114,11 +1114,11 @@ hash_linear_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int err switch (status) { case ST_DELETE: - return ST_DELETE; + return ST_DELETE; case ST_CONTINUE: - break; + break; case ST_STOP: - return ST_STOP; + return ST_STOP; } return ST_CHECK; } @@ -1186,7 +1186,7 @@ hash_foreach_call(VALUE arg) (st_data_t)arg, (st_data_t)Qundef); } if (ret) { - rb_raise(rb_eRuntimeError, "ret: %d, hash modified during iteration", ret); + rb_raise(rb_eRuntimeError, "ret: %d, hash modified during iteration", ret); } return Qnil; } @@ -1266,9 +1266,9 @@ hash_dup(VALUE hash, VALUE klass, VALUE flags) VALUE ret = hash_alloc_flags(klass, flags, RHASH_IFNONE(hash)); if (!RHASH_EMPTY_P(hash)) { - if (RHASH_ARRAY_P(hash)) - linear_copy(ret, hash); - else if (RHASH_TABLE_P(hash)) + if (RHASH_ARRAY_P(hash)) + linear_copy(ret, hash); + else if (RHASH_TABLE_P(hash)) RHASH_ST_TABLE_SET(ret, st_copy(RHASH_ST_TABLE(hash))); } return ret; @@ -1498,15 +1498,15 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass) VALUE hash, tmp; if (argc == 1) { - tmp = rb_hash_s_try_convert(Qnil, argv[0]); //TODO tmp array flag + tmp = rb_hash_s_try_convert(Qnil, argv[0]); //TODO tmp array flag if (!NIL_P(tmp)) { hash = hash_alloc(klass); - if (RHASH_ARRAY_P(tmp)) { - linear_copy(hash, tmp); + if (RHASH_ARRAY_P(tmp)) { + linear_copy(hash, tmp); } else { - RHASH_ST_TABLE_SET(hash, st_copy(RHASH_ST_TABLE(tmp))); - } + RHASH_ST_TABLE_SET(hash, st_copy(RHASH_ST_TABLE(tmp))); + } return hash; } @@ -1596,10 +1596,10 @@ static int rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg) { if (RHASH_ARRAY_P(arg)) { - linear_insert(arg, (st_data_t)key, (st_data_t)value); + linear_insert(arg, (st_data_t)key, (st_data_t)value); } else { - st_insert(RHASH_ST_TABLE(arg), (st_data_t)key, (st_data_t)value); + st_insert(RHASH_ST_TABLE(arg), (st_data_t)key, (st_data_t)value); } return ST_CONTINUE; } @@ -1635,22 +1635,22 @@ rb_hash_rehash(VALUE hash) } rb_hash_modify_check(hash); if (RHASH_ARRAY_P(hash)) { - tmp = hash_alloc(0); - linear_init_table(tmp); - rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp); - linear_free_and_clear_table(hash); + tmp = hash_alloc(0); + linear_init_table(tmp); + rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp); + linear_free_and_clear_table(hash); linear_copy(hash, tmp); - linear_free_and_clear_table(tmp); + linear_free_and_clear_table(tmp); } else if (RHASH_TABLE_P(hash)) { - st_table *old_tab = RHASH_ST_TABLE(hash); - tmp = hash_alloc(0); - tbl = st_init_table_with_size(old_tab->type, old_tab->num_entries); + st_table *old_tab = RHASH_ST_TABLE(hash); + tmp = hash_alloc(0); + tbl = st_init_table_with_size(old_tab->type, old_tab->num_entries); RHASH_ST_TABLE_SET(tmp, tbl); - rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp); - st_free_table(old_tab); - RHASH_ST_TABLE_SET(hash, tbl); - RHASH_CLEAR(tmp); + rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp); + st_free_table(old_tab); + RHASH_ST_TABLE_SET(hash, tbl); + RHASH_CLEAR(tmp); } hash_verify(hash); return hash; @@ -1690,10 +1690,10 @@ rb_hash_aref(VALUE hash, VALUE key) st_data_t val; if (RHASH_ARRAY_P(hash) && linear_lookup(hash, key, &val)) { - return (VALUE)val; + return (VALUE)val; } else if (RHASH_TABLE_P(hash) && st_lookup(RHASH_ST_TABLE(hash), key, &val)) { - return (VALUE)val; + return (VALUE)val; } hash_verify(hash); return rb_hash_default_value(hash, key); @@ -1775,19 +1775,19 @@ rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash) rb_warn("block supersedes default value argument"); } if (RHASH_ARRAY_P(hash) && linear_lookup(hash, key, &val)) { - return (VALUE)val; + return (VALUE)val; } else if (RHASH_TABLE_P(hash) && st_lookup(RHASH_ST_TABLE(hash), key, &val)) { - return (VALUE)val; + return (VALUE)val; } if (block_given) return rb_yield(key); if (argc == 1) { - VALUE desc = rb_protect(rb_inspect, key, 0); - if (NIL_P(desc)) { - desc = rb_any_to_s(key); + VALUE desc = rb_protect(rb_inspect, key, 0); + if (NIL_P(desc)) { + desc = rb_any_to_s(key); } - desc = rb_str_ellipsize(desc, 65); - rb_key_err_raise(rb_sprintf("key not found: %"PRIsVALUE, desc), hash, key); + desc = rb_str_ellipsize(desc, 65); + rb_key_err_raise(rb_sprintf("key not found: %"PRIsVALUE, desc), hash, key); } hash_verify(hash); return argv[1]; @@ -2092,26 +2092,26 @@ rb_hash_shift(VALUE hash) if (RHASH_ARRAY_P(hash)) { var.key = Qundef; if (RHASH_ITER_LEV(hash) == 0) { - if (linear_shift(hash, &var.key, &var.val)) { + if (linear_shift(hash, &var.key, &var.val)) { return rb_assoc_new(var.key, var.val); } } else { rb_hash_foreach(hash, shift_i_safe, (VALUE)&var); - if (var.key != Qundef) { - rb_hash_delete_entry(hash, var.key); - return rb_assoc_new(var.key, var.val); - } - } + if (var.key != Qundef) { + rb_hash_delete_entry(hash, var.key); + return rb_assoc_new(var.key, var.val); + } + } } if (RHASH_TABLE_P(hash)) { - var.key = Qundef; - if (RHASH_ITER_LEV(hash) == 0) { - if (st_shift(RHASH_ST_TABLE(hash), &var.key, &var.val)) { - return rb_assoc_new(var.key, var.val); - } - } - else { + var.key = Qundef; + if (RHASH_ITER_LEV(hash) == 0) { + if (st_shift(RHASH_ST_TABLE(hash), &var.key, &var.val)) { + return rb_assoc_new(var.key, var.val); + } + } + else { rb_hash_foreach(hash, shift_i_safe, (VALUE)&var); if (var.key != Qundef) { rb_hash_delete_entry(hash, var.key); @@ -2511,7 +2511,7 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val) if (RHASH_TABLE_EMPTY(hash)) { if (iter_lev > 0) no_new_key(); - linear_init_table(hash); + linear_init_table(hash); } if (RHASH_TYPE(hash) == &identhash || rb_obj_class(key) != rb_cString) { @@ -2543,22 +2543,22 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2) if (hash == hash2) return hash; if (RHASH_ARRAY_P(hash2)) { - if (RHASH_ARRAY_P(hash)) linear_free_and_clear_table(hash); - linear_copy(hash, hash2); - if (RHASH_ARRAY_SIZE(hash)) + if (RHASH_ARRAY_P(hash)) linear_free_and_clear_table(hash); + linear_copy(hash, hash2); + if (RHASH_ARRAY_SIZE(hash)) rb_hash_rehash(hash); } else if (RHASH_TABLE_P(hash2)) { - if (RHASH_TABLE_P(hash)) st_free_table(RHASH_ST_TABLE(hash)); + if (RHASH_TABLE_P(hash)) st_free_table(RHASH_ST_TABLE(hash)); RHASH_ST_TABLE_SET(hash, st_copy(RHASH_ST_TABLE(hash2))); - if (RHASH_ST_TABLE(hash)->num_entries) - rb_hash_rehash(hash); + if (RHASH_ST_TABLE(hash)->num_entries) + rb_hash_rehash(hash); } else if (RHASH_ARRAY_P(hash)) { - linear_clear(hash); + linear_clear(hash); } else if (RHASH_TABLE_P(hash)) { - st_clear(RHASH_ST_TABLE(hash)); + st_clear(RHASH_ST_TABLE(hash)); } COPY_DEFAULT(hash, hash2); @@ -3096,20 +3096,20 @@ rb_hash_keys(VALUE hash) if (size == 0) return keys; if (ST_DATA_COMPATIBLE_P(VALUE)) { - if (RHASH_ARRAY_P(hash)) { - rb_gc_writebarrier_remember(keys); - RARRAY_PTR_USE(keys, ptr, { - size = linear_keys(hash, ptr, size); - }); - } - else if (RHASH_TABLE_P(hash)) { - st_table *table = RHASH_ST_TABLE(hash); + if (RHASH_ARRAY_P(hash)) { + rb_gc_writebarrier_remember(keys); + RARRAY_PTR_USE(keys, ptr, { + size = linear_keys(hash, ptr, size); + }); + } + else if (RHASH_TABLE_P(hash)) { + st_table *table = RHASH_ST_TABLE(hash); - rb_gc_writebarrier_remember(keys); - RARRAY_PTR_USE(keys, ptr, { - size = st_keys(table, ptr, size); - }); - } + rb_gc_writebarrier_remember(keys); + RARRAY_PTR_USE(keys, ptr, { + size = st_keys(table, ptr, size); + }); + } rb_ary_set_len(keys, size); } else { @@ -3148,20 +3148,20 @@ rb_hash_values(VALUE hash) if (size == 0) return values; if (ST_DATA_COMPATIBLE_P(VALUE)) { - if (RHASH_ARRAY_P(hash)) { - rb_gc_writebarrier_remember(values); - RARRAY_PTR_USE(values, ptr, { - size = linear_values(hash, ptr, size); - }); - } - else if (RHASH_TABLE_P(hash)) { - st_table *table = RHASH_ST_TABLE(hash); + if (RHASH_ARRAY_P(hash)) { + rb_gc_writebarrier_remember(values); + RARRAY_PTR_USE(values, ptr, { + size = linear_values(hash, ptr, size); + }); + } + else if (RHASH_TABLE_P(hash)) { + st_table *table = RHASH_ST_TABLE(hash); - rb_gc_writebarrier_remember(values); - RARRAY_PTR_USE(values, ptr, { - size = st_values(table, ptr, size); - }); - } + rb_gc_writebarrier_remember(values); + RARRAY_PTR_USE(values, ptr, { + size = st_values(table, ptr, size); + }); + } rb_ary_set_len(values, size); } else { @@ -3255,8 +3255,8 @@ eql_i(VALUE key, VALUE val1, VALUE arg) return ST_STOP; } else if (RHASH_TABLE_P(data->hash) && !st_lookup(RHASH_ST_TABLE(data->hash), key, &val2)) { - data->result = Qfalse; - return ST_STOP; + data->result = Qfalse; + return ST_STOP; } if (!(data->eql ? rb_eql(val1, (VALUE)val2) : (int)rb_equal(val1, (VALUE)val2))) { @@ -3304,14 +3304,14 @@ hash_equal(VALUE hash1, VALUE hash2, int eql) if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2)) return Qfalse; if (!RHASH_TABLE_EMPTY(hash1) && !RHASH_TABLE_EMPTY(hash2)) { - if (RHASH_TYPE(hash1) != RHASH_TYPE(hash2)) - return Qfalse; + if (RHASH_TYPE(hash1) != RHASH_TYPE(hash2)) + return Qfalse; - data.hash = hash2; - data.eql = eql; - return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data); + data.hash = hash2; + data.eql = eql; + return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data); } - + #if 0 if (!(rb_equal(RHASH_IFNONE(hash1), RHASH_IFNONE(hash2)) && FL_TEST(hash1, HASH_PROC_DEFAULT) == FL_TEST(hash2, HASH_PROC_DEFAULT))) @@ -3896,7 +3896,7 @@ rb_hash_compact_bang(VALUE hash) n = RHASH_SIZE(hash); if (n) { rb_hash_foreach(hash, delete_if_nil, hash); - if (n != RHASH_SIZE(hash)) + if (n != RHASH_SIZE(hash)) return hash; } return Qnil; @@ -4237,9 +4237,9 @@ rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val) //TODO if (RHASH_ARRAY_P(hash)) { hash_ltbl(hash); - ret = linear_update(hash, (st_data_t)key, add_new_i, (st_data_t)args); + ret = linear_update(hash, (st_data_t)key, add_new_i, (st_data_t)args); if (ret != -1) { - return ret; + return ret; } linear_try_convert_table(hash); } @@ -4260,11 +4260,11 @@ linear_bulk_insert(VALUE hash, long argc, const VALUE *argv) { long i; for (i = 0; i < argc; ) { - st_data_t k = key_stringify(argv[i++]); - st_data_t v = argv[i++]; - linear_insert(hash, k, v); - RB_OBJ_WRITTEN(hash, Qundef, k); - RB_OBJ_WRITTEN(hash, Qundef, v); + st_data_t k = key_stringify(argv[i++]); + st_data_t v = argv[i++]; + linear_insert(hash, k, v); + RB_OBJ_WRITTEN(hash, Qundef, k); + RB_OBJ_WRITTEN(hash, Qundef, v); } } @@ -4278,15 +4278,15 @@ rb_hash_bulk_insert(long argc, const VALUE *argv, VALUE hash) return; size = argc / 2; if (RHASH_TABLE_EMPTY(hash)) { - if (size <= RHASH_ARRAY_MAX_SIZE) - hash_ltbl(hash); - else + if (size <= RHASH_ARRAY_MAX_SIZE) + hash_ltbl(hash); + else RHASH_TBL_RAW(hash); } - if (RHASH_ARRAY_P(hash) && + if (RHASH_ARRAY_P(hash) && (RHASH_ARRAY_SIZE(hash) + size <= RHASH_ARRAY_MAX_SIZE)) { - linear_bulk_insert(hash, argc, argv); - return; + linear_bulk_insert(hash, argc, argv); + return; } rb_hash_bulk_insert_into_st_table(argc, argv, hash); diff --git a/internal.h b/internal.h index 761c8412dc..7224346b99 100644 --- a/internal.h +++ b/internal.h @@ -740,8 +740,8 @@ typedef struct li_table { struct RHash { struct RBasic basic; union { - struct st_table *st; - struct li_table *li; /* possibly 0 */ + struct st_table *st; + struct li_table *li; /* possibly 0 */ } as; int iter_lev; const VALUE ifnone; @@ -887,7 +887,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) else { w_byte(TYPE_HASH_DEF, arg); } - w_long(rb_hash_size_num(obj), arg); + w_long(rb_hash_size_num(obj), arg); rb_hash_foreach(obj, hash_each, (st_data_t)&c_arg); if (!NIL_P(RHASH_IFNONE(obj))) { w_object(RHASH_IFNONE(obj), arg, limit); diff --git a/transient_heap.c b/transient_heap.c index 077b46097c..27e7093210 100644 --- a/transient_heap.c +++ b/transient_heap.c @@ -569,12 +569,12 @@ transient_heap_ptr(VALUE obj, int error) case T_HASH: if (RHASH_TRANSIENT_P(obj)) { TH_ASSERT(RHASH_ARRAY_P(obj)); - ptr = (VALUE *)(RHASH(obj)->as.li); - } - else { - ptr = NULL; - } - break; + ptr = (VALUE *)(RHASH(obj)->as.li); + } + else { + ptr = NULL; + } + break; default: if (error) { rb_bug("transient_heap_ptr: unknown obj %s\n", rb_obj_info(obj)); @@ -666,8 +666,8 @@ transient_heap_block_evacuate(struct transient_heap* theap, struct transient_hea while (marked_index >= 0) { struct transient_alloc_header *header = alloc_header(block, marked_index); VALUE obj = header->obj; - TH_ASSERT(header->magic == TRANSIENT_HEAP_ALLOC_MAGIC); - if (header->magic != TRANSIENT_HEAP_ALLOC_MAGIC) rb_bug("rb_transient_heap_mark: wrong header %s\n", rb_obj_info(obj)); + TH_ASSERT(header->magic == TRANSIENT_HEAP_ALLOC_MAGIC); + if (header->magic != TRANSIENT_HEAP_ALLOC_MAGIC) rb_bug("rb_transient_heap_mark: wrong header %s\n", rb_obj_info(obj)); if (TRANSIENT_HEAP_DEBUG >= 3) fprintf(stderr, " * transient_heap_block_evacuate %p %s\n", header, rb_obj_info(obj)); diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 3e877f1210..9136a4aee4 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3327,7 +3327,7 @@ vm_case_dispatch(CDHASH hash, OFFSET else_offset, VALUE key) key = FIXABLE(kval) ? LONG2FIX((long)kval) : rb_dbl2big(kval); } } - if (rb_hash_stlike_lookup(hash, key, &val)) { + if (rb_hash_stlike_lookup(hash, key, &val)) { return FIX2LONG((VALUE)val); } else { |