ruby-changes:47020
From: nobu <ko1@a...>
Date: Wed, 21 Jun 2017 21:51:32 +0900 (JST)
Subject: [ruby-changes:47020] nobu:r59135 (trunk): gc.c: FL_CHECK2
nobu 2017-06-21 21:51:26 +0900 (Wed, 21 Jun 2017) New Revision: 59135 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59135 Log: gc.c: FL_CHECK2 * gc.c (FL_TEST2, FL_SET2, FL_UNSET2): make error messages consitent. Modified files: trunk/gc.c Index: gc.c =================================================================== --- gc.c (revision 59134) +++ gc.c (revision 59135) @@ -1016,9 +1016,12 @@ tick(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L1016 #define MEASURE_LINE(expr) expr #endif /* USE_TICK_T */ -#define FL_TEST2(x,f) ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? (rb_bug("FL_TEST2: SPECIAL_CONST (%p)", (void *)(x)), 0) : FL_TEST_RAW((x),(f)) != 0) -#define FL_SET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_SET2: SPECIAL_CONST"); RBASIC(x)->flags |= (f);} while (0) -#define FL_UNSET2(x,f) do {if (RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) rb_bug("FL_UNSET2: SPECIAL_CONST"); RBASIC(x)->flags &= ~(f);} while (0) +#define FL_CHECK2(name, x, pred) \ + ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? \ + (rb_bug(name": SPECIAL_CONST (%p)", (void *)(x)), 0) : (pred)) +#define FL_TEST2(x,f) FL_CHECK2("FL_TEST2", x, FL_TEST_RAW((x),(f)) != 0) +#define FL_SET2(x,f) FL_CHECK2("FL_SET2", x, RBASIC(x)->flags |= (f)) +#define FL_UNSET2(x,f) FL_CHECK2("FL_UNSET2", x, RBASIC(x)->flags &= ~(f)) #define RVALUE_MARK_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), (obj)) #define RVALUE_PAGE_MARKED(page, obj) MARKED_IN_BITMAP((page)->mark_bits, (obj)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/