Adjusted styles
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cc02df324f
commit
5ae753dfa3
54
gc.c
54
gc.c
@ -1147,7 +1147,8 @@ gc_object_moved_p(rb_objspace_t * objspace, VALUE obj)
|
|||||||
{
|
{
|
||||||
if (RB_SPECIAL_CONST_P(obj)) {
|
if (RB_SPECIAL_CONST_P(obj)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
void *poisoned = poisoned_object_p(obj);
|
void *poisoned = poisoned_object_p(obj);
|
||||||
unpoison_object(obj, false);
|
unpoison_object(obj, false);
|
||||||
|
|
||||||
@ -3395,7 +3396,8 @@ rb_obj_id(VALUE obj)
|
|||||||
if (st_lookup(obj_to_id_tbl, (st_data_t)obj, &id)) {
|
if (st_lookup(obj_to_id_tbl, (st_data_t)obj, &id)) {
|
||||||
gc_report(4, &rb_objspace, "Second time object_id was called on this object: %p\n", (void*)obj);
|
gc_report(4, &rb_objspace, "Second time object_id was called on this object: %p\n", (void*)obj);
|
||||||
return id;
|
return id;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
id = nonspecial_obj_id(obj);
|
id = nonspecial_obj_id(obj);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -3405,7 +3407,8 @@ rb_obj_id(VALUE obj)
|
|||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
objspace->profile.object_id_collisions++;
|
objspace->profile.object_id_collisions++;
|
||||||
id += 40;
|
id += 40;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
gc_report(4, &rb_objspace, "Initial insert: %p id: %d\n", (void*)obj, NUM2INT(id));
|
gc_report(4, &rb_objspace, "Initial insert: %p id: %d\n", (void*)obj, NUM2INT(id));
|
||||||
st_insert(obj_to_id_tbl, (st_data_t)obj, id);
|
st_insert(obj_to_id_tbl, (st_data_t)obj, id);
|
||||||
st_insert(id_to_obj_tbl, (st_data_t)id, obj);
|
st_insert(id_to_obj_tbl, (st_data_t)id, obj);
|
||||||
@ -4422,7 +4425,8 @@ mark_keyvalue(st_data_t key, st_data_t value, st_data_t data)
|
|||||||
|
|
||||||
if (SPECIAL_CONST_P((VALUE)key) || BUILTIN_TYPE((VALUE)key) == T_STRING) {
|
if (SPECIAL_CONST_P((VALUE)key) || BUILTIN_TYPE((VALUE)key) == T_STRING) {
|
||||||
gc_mark(objspace, (VALUE)key);
|
gc_mark(objspace, (VALUE)key);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
gc_mark_and_pin(objspace, (VALUE)key);
|
gc_mark_and_pin(objspace, (VALUE)key);
|
||||||
}
|
}
|
||||||
gc_mark(objspace, (VALUE)value);
|
gc_mark(objspace, (VALUE)value);
|
||||||
@ -7218,7 +7222,8 @@ update_id_to_obj(st_data_t *key, st_data_t *value, st_data_t arg, int exists)
|
|||||||
if (exists) {
|
if (exists) {
|
||||||
*value = arg;
|
*value = arg;
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return ST_STOP;
|
return ST_STOP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7274,25 +7279,29 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free)
|
|||||||
/* Set bits for object in new location */
|
/* Set bits for object in new location */
|
||||||
if (marking) {
|
if (marking) {
|
||||||
MARK_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
|
MARK_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
|
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (marked) {
|
if (marked) {
|
||||||
MARK_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
|
MARK_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
|
CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wb_unprotected) {
|
if (wb_unprotected) {
|
||||||
MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
|
MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
|
CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uncollectible) {
|
if (uncollectible) {
|
||||||
MARK_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
|
MARK_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
|
CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7316,7 +7325,8 @@ advance_cursor(struct heap_cursor *free, struct heap_page **page_list)
|
|||||||
free->index++;
|
free->index++;
|
||||||
free->page = page_list[free->index];
|
free->page = page_list[free->index];
|
||||||
free->slot = free->page->start;
|
free->slot = free->page->start;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
free->slot++;
|
free->slot++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7328,7 +7338,8 @@ retreat_cursor(struct heap_cursor *scan, struct heap_page **page_list)
|
|||||||
scan->index--;
|
scan->index--;
|
||||||
scan->page = page_list[scan->index];
|
scan->page = page_list[scan->index];
|
||||||
scan->slot = scan->page->start + scan->page->total_slots - 1;
|
scan->slot = scan->page->start + scan->page->total_slots - 1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
scan->slot--;
|
scan->slot--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7688,7 +7699,8 @@ rb_gc_new_location(VALUE value)
|
|||||||
if (BUILTIN_TYPE(value) == T_MOVED) {
|
if (BUILTIN_TYPE(value) == T_MOVED) {
|
||||||
destination = (VALUE)RMOVED(value)->destination;
|
destination = (VALUE)RMOVED(value)->destination;
|
||||||
assert(BUILTIN_TYPE(destination) != T_NONE);
|
assert(BUILTIN_TYPE(destination) != T_NONE);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
destination = value;
|
destination = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7697,7 +7709,8 @@ rb_gc_new_location(VALUE value)
|
|||||||
GC_ASSERT(BUILTIN_TYPE(value) == T_NONE);
|
GC_ASSERT(BUILTIN_TYPE(value) == T_NONE);
|
||||||
poison_object(value);
|
poison_object(value);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
destination = value;
|
destination = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7813,7 +7826,8 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
|
|||||||
case T_ARRAY:
|
case T_ARRAY:
|
||||||
if (FL_TEST(obj, ELTS_SHARED)) {
|
if (FL_TEST(obj, ELTS_SHARED)) {
|
||||||
UPDATE_IF_MOVED(objspace, any->as.array.as.heap.aux.shared);
|
UPDATE_IF_MOVED(objspace, any->as.array.as.heap.aux.shared);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
gc_ref_update_array(objspace, obj);
|
gc_ref_update_array(objspace, obj);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -7936,7 +7950,8 @@ gc_ref_update(void *vstart, void *vend, size_t stride, void * data)
|
|||||||
if (BUILTIN_TYPE(v) == T_NONE) {
|
if (BUILTIN_TYPE(v) == T_NONE) {
|
||||||
heap_page_add_freeobj(objspace, page, v);
|
heap_page_add_freeobj(objspace, page, v);
|
||||||
free_slots++;
|
free_slots++;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (RVALUE_WB_UNPROTECTED(v)) {
|
if (RVALUE_WB_UNPROTECTED(v)) {
|
||||||
page->flags.has_uncollectible_shady_objects = TRUE;
|
page->flags.has_uncollectible_shady_objects = TRUE;
|
||||||
}
|
}
|
||||||
@ -8041,7 +8056,8 @@ heap_check_moved_i(void *vstart, void *vend, size_t stride, void *data)
|
|||||||
for (; v != (VALUE)vend; v += stride) {
|
for (; v != (VALUE)vend; v += stride) {
|
||||||
if (gc_object_moved_p(&rb_objspace, v)) {
|
if (gc_object_moved_p(&rb_objspace, v)) {
|
||||||
/* Moved object still on the heap, something may have a reference. */
|
/* Moved object still on the heap, something may have a reference. */
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
void *poisoned = poisoned_object_p(v);
|
void *poisoned = poisoned_object_p(v);
|
||||||
unpoison_object(v, false);
|
unpoison_object(v, false);
|
||||||
|
|
||||||
@ -9774,7 +9790,8 @@ wmap_pin_obj(st_data_t key, st_data_t val, st_data_t arg)
|
|||||||
VALUE obj = (VALUE)val;
|
VALUE obj = (VALUE)val;
|
||||||
if (obj && is_live_object(objspace, obj)) {
|
if (obj && is_live_object(objspace, obj)) {
|
||||||
gc_pin(objspace, obj);
|
gc_pin(objspace, obj);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return ST_DELETE;
|
return ST_DELETE;
|
||||||
}
|
}
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
@ -11101,7 +11118,8 @@ rb_gcdebug_print_obj_condition(VALUE obj)
|
|||||||
|
|
||||||
if (BUILTIN_TYPE(obj) == T_MOVED) {
|
if (BUILTIN_TYPE(obj) == T_MOVED) {
|
||||||
fprintf(stderr, "moved?: true\n");
|
fprintf(stderr, "moved?: true\n");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
fprintf(stderr, "moved?: false\n");
|
fprintf(stderr, "moved?: false\n");
|
||||||
}
|
}
|
||||||
if (is_pointer_to_heap(objspace, (void *)obj)) {
|
if (is_pointer_to_heap(objspace, (void *)obj)) {
|
||||||
|
@ -281,7 +281,8 @@ rb_id_table_foreach_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_fu
|
|||||||
VALUE val = tbl->items[i].val;
|
VALUE val = tbl->items[i].val;
|
||||||
ret = (*replace)(Qundef, &val, data, TRUE);
|
ret = (*replace)(Qundef, &val, data, TRUE);
|
||||||
tbl->items[i].val = val;
|
tbl->items[i].val = val;
|
||||||
} else if (ret == ID_TABLE_STOP)
|
}
|
||||||
|
else if (ret == ID_TABLE_STOP)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
io.c
3
io.c
@ -10996,7 +10996,8 @@ nogvl_fcopyfile(struct copy_stream_struct *stp)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case ENOTSUP:
|
case ENOTSUP:
|
||||||
case EPERM:
|
case EPERM:
|
||||||
|
@ -1180,7 +1180,8 @@ mjit_copy_cache_from_main_thread(const rb_iseq_t *iseq, struct rb_call_cache *cc
|
|||||||
|
|
||||||
if (UNLIKELY(mjit_opts.wait)) {
|
if (UNLIKELY(mjit_opts.wait)) {
|
||||||
mjit_copy_job_handler((void *)job);
|
mjit_copy_job_handler((void *)job);
|
||||||
} else if (rb_workqueue_register(0, mjit_copy_job_handler, (void *)job)) {
|
}
|
||||||
|
else if (rb_workqueue_register(0, mjit_copy_job_handler, (void *)job)) {
|
||||||
CRITICAL_SECTION_START(3, "in MJIT copy job wait");
|
CRITICAL_SECTION_START(3, "in MJIT copy job wait");
|
||||||
// checking `stop_worker_p` too because `RUBY_VM_CHECK_INTS(ec)` may not
|
// checking `stop_worker_p` too because `RUBY_VM_CHECK_INTS(ec)` may not
|
||||||
// lush mjit_copy_job_handler when EC_EXEC_TAG() is not TAG_NONE, and then
|
// lush mjit_copy_job_handler when EC_EXEC_TAG() is not TAG_NONE, and then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user