ruby-changes:64644
From: Nobuyoshi <ko1@a...>
Date: Mon, 28 Dec 2020 20:46:47 +0900 (JST)
Subject: [ruby-changes:64644] 09aca50fc4 (master): Adjusted styles [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=09aca50fc4 From 09aca50fc4be0b8bffe89b3583aedfe9c5c3a732 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 28 Dec 2020 19:52:14 +0900 Subject: Adjusted styles [ci skip] diff --git a/cont.c b/cont.c index d2a3478..524068b 100644 --- a/cont.c +++ b/cont.c @@ -593,7 +593,8 @@ fiber_pool_allocation_free(struct fiber_pool_allocation * allocation) https://github.com/ruby/ruby/blob/trunk/cont.c#L593 // Acquire a stack from the given fiber pool. If none are available, allocate more. static struct fiber_pool_stack -fiber_pool_stack_acquire(struct fiber_pool * fiber_pool) { +fiber_pool_stack_acquire(struct fiber_pool * fiber_pool) +{ struct fiber_pool_vacancy * vacancy = fiber_pool_vacancy_pop(fiber_pool); if (DEBUG) fprintf(stderr, "fiber_pool_stack_acquire: %p used=%"PRIuSIZE"\n", (void*)fiber_pool->vacancies, fiber_pool->used); @@ -1906,7 +1907,8 @@ rb_f_fiber_kw(int argc, VALUE* argv, int kw_splat) https://github.com/ruby/ruby/blob/trunk/cont.c#L1907 if (scheduler != Qnil) { fiber = rb_funcall_passing_block_kw(scheduler, rb_intern("fiber"), argc, argv, kw_splat); - } else { + } + else { rb_raise(rb_eRuntimeError, "No scheduler is available!"); } diff --git a/gc.c b/gc.c index 9303764..3989a80 100644 --- a/gc.c +++ b/gc.c @@ -2369,7 +2369,8 @@ rb_newobj_of(VALUE klass, VALUE flags) https://github.com/ruby/ruby/blob/trunk/gc.c#L2369 { if ((flags & RUBY_T_MASK) == T_OBJECT) { return newobj_of(klass, (flags | ROBJECT_EMBED) & ~FL_WB_PROTECTED , Qundef, Qundef, Qundef, flags & FL_WB_PROTECTED); - } else { + } + else { return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED); } } @@ -3131,7 +3132,8 @@ object_id_cmp(st_data_t x, st_data_t y) https://github.com/ruby/ruby/blob/trunk/gc.c#L3132 { if (RB_TYPE_P(x, T_BIGNUM)) { return !rb_big_eql(x, y); - } else { + } + else { return x != y; } } @@ -3141,7 +3143,8 @@ object_id_hash(st_data_t n) https://github.com/ruby/ruby/blob/trunk/gc.c#L3143 { if (RB_TYPE_P(n, T_BIGNUM)) { return FIX2LONG(rb_big_hash(n)); - } else { + } + else { return st_numhash(n); } } @@ -4014,7 +4017,8 @@ id2ref(VALUE objid) https://github.com/ruby/ruby/blob/trunk/gc.c#L4017 if (rb_int_ge(objid, objspace->next_object_id)) { rb_raise(rb_eRangeError, "%+"PRIsVALUE" is not id value", rb_int2str(objid, 10)); - } else { + } + else { rb_raise(rb_eRangeError, "%+"PRIsVALUE" is recycled object", rb_int2str(objid, 10)); } } @@ -4496,7 +4500,8 @@ lock_page_body(rb_objspace_t *objspace, struct heap_page_body *body) https://github.com/ruby/ruby/blob/trunk/gc.c#L4500 if(mprotect(body, HEAP_PAGE_SIZE, PROT_NONE)) { #endif rb_bug("Couldn't protect page %p", (void *)body); - } else { + } + else { gc_report(5, objspace, "Protecting page in move %p\n", (void *)body); } } @@ -4517,7 +4522,8 @@ unlock_page_body(rb_objspace_t *objspace, struct heap_page_body *body) https://github.com/ruby/ruby/blob/trunk/gc.c#L4522 if(mprotect(body, HEAP_PAGE_SIZE, PROT_READ | PROT_WRITE)) { #endif rb_bug("Couldn't unprotect page %p", (void *)body); - } else { + } + else { gc_report(5, objspace, "Unprotecting page in move %p\n", (void *)body); } } @@ -4619,7 +4625,8 @@ gc_unprotect_pages(rb_objspace_t *objspace, rb_heap_t *heap) https://github.com/ruby/ruby/blob/trunk/gc.c#L4625 static void gc_update_references(rb_objspace_t * objspace, rb_heap_t *heap); static void invalidate_moved_page(rb_objspace_t *objspace, struct heap_page *page); -static void read_barrier_handler(intptr_t address) +static void +read_barrier_handler(intptr_t address) { VALUE obj; rb_objspace_t * objspace = &rb_objspace; @@ -4644,7 +4651,8 @@ static LPTOP_LEVEL_EXCEPTION_FILTER old_handler; https://github.com/ruby/ruby/blob/trunk/gc.c#L4651 typedef void (*signal_handler)(int); static signal_handler old_sigsegv_handler; -static LONG WINAPI read_barrier_signal(EXCEPTION_POINTERS * info) +static LONG WINAPI +read_barrier_signal(EXCEPTION_POINTERS * info) { /* EXCEPTION_ACCESS_VIOLATION is what's raised by access to protected pages */ if (info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { @@ -4654,7 +4662,8 @@ static LONG WINAPI read_barrier_signal(EXCEPTION_POINTERS * info) https://github.com/ruby/ruby/blob/trunk/gc.c#L4662 * Use this address to invalidate the page */ read_barrier_handler((intptr_t)info->ExceptionRecord->ExceptionInformation[1]); return EXCEPTION_CONTINUE_EXECUTION; - } else { + } + else { return EXCEPTION_CONTINUE_SEARCH; } } @@ -4815,12 +4824,14 @@ gc_fill_swept_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *s https://github.com/ruby/ruby/blob/trunk/gc.c#L4824 if (finished_compacting) { if (BUILTIN_TYPE(dest) == T_NONE) { (*empty_slots)++; - } else { + } + else { (*freed_slots)++; } (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)dest, sizeof(RVALUE)); heap_page_add_freeobj(objspace, sweep_page, dest); - } else { + } + else { /* Zombie slots don't get marked, but we can't reuse * their memory until they have their finalizers run.*/ if (BUILTIN_TYPE(dest) != T_ZOMBIE) { @@ -4830,12 +4841,14 @@ gc_fill_swept_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *s https://github.com/ruby/ruby/blob/trunk/gc.c#L4841 gc_report(5, objspace, "Quit compacting, couldn't find an object to move\n"); if (BUILTIN_TYPE(dest) == T_NONE) { (*empty_slots)++; - } else { + } + else { (*freed_slots)++; } heap_page_add_freeobj(objspace, sweep_page, dest); gc_report(3, objspace, "page_sweep: %s is added to freelist\n", obj_info(dest)); - } else { + } + else { moved_slots++; } } @@ -4868,7 +4881,8 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_ https://github.com/ruby/ruby/blob/trunk/gc.c#L4881 /* The compaction cursor and sweep page met, so we need to quit compacting */ gc_report(5, objspace, "Quit compacting, mark and compact cursor met\n"); gc_compact_finish(objspace, heap); - } else { + } + else { /* We anticipate filling the page, so NULL out the freelist. */ asan_unpoison_memory_region(&sweep_page->freelist, sizeof(RVALUE*), false); sweep_page->freelist = NULL; @@ -4915,7 +4929,8 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_ https://github.com/ruby/ruby/blob/trunk/gc.c#L4929 if (heap->compact_cursor) { /* We *want* to fill this slot */ MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(vp), vp); - } else { + } + else { (void)VALGRIND_MAKE_MEM_UNDEFINED((void*)p, sizeof(RVALUE)); heap_page_add_freeobj(objspace, sweep_page, vp); gc_report(3, objspace, "page_sweep: %s is added to freelist\n", obj_info(vp)); @@ -4938,7 +4953,8 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_ https://github.com/ruby/ruby/blob/trunk/gc.c#L4953 gc_report(3, objspace, "page_sweep: %s is added to freelist\n", obj_info(vp)); if (FL_TEST(vp, FL_FROM_FREELIST)) { empty_slots++; - } else { + } + else { freed_slots++; } heap_page_add_freeobj(objspace, sweep_page, vp); @@ -4950,7 +4966,8 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_ https://github.com/ruby/ruby/blob/trunk/gc.c#L4966 if (heap->compact_cursor) { /* We *want* to fill this slot */ MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(vp), vp); - } else { + } + else { /* When we started sweeping this page, we were in * compacting mode and nulled the free list for * the page. But compaction finished, so we need to @@ -5237,7 +5254,8 @@ invalidate_moved_page(rb_objspace_t *objspace, struct heap_page *page) https://github.com/ruby/ruby/blob/trunk/gc.c#L5254 if (FL_TEST(forwarding_object, FL_FROM_FREELIST)) { empty_slots++; /* already freed */ - } else { + } + else { freed_slots++; } @@ -8532,7 +8550,8 @@ gc_start_internal(rb_execution_context_t *ec, VALUE self, VALUE full_mark, VALUE https://github.com/ruby/rub (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/