зеркало из https://github.com/github/ruby.git
gc.c: restrict RGENGC_DEBUG
* gc.c (RGENGC_DEBUG_ENABLED): restrict runtime ruby_rgengc_debug level up to -RGENGC_DEBUG, to reduce runtime branches in inner loops. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5235446a31
Коммит
5bdb4e0566
9
gc.c
9
gc.c
|
@ -228,8 +228,9 @@ static ruby_gc_params_t gc_params = {
|
|||
#endif
|
||||
#endif
|
||||
#if RGENGC_DEBUG < 0
|
||||
#undef RGENGC_DEBUG
|
||||
#define RGENGC_DEBUG ruby_rgengc_debug
|
||||
# define RGENGC_DEBUG_ENABLED(level) (-(RGENGC_DEBUG) >= (level) && ruby_rgengc_debug >= (level))
|
||||
#else
|
||||
# define RGENGC_DEBUG_ENABLED(level) ((RGENGC_DEBUG) >= (level))
|
||||
#endif
|
||||
int ruby_rgengc_debug;
|
||||
|
||||
|
@ -910,9 +911,9 @@ static inline void gc_prof_set_heap_info(rb_objspace_t *);
|
|||
|
||||
#ifdef HAVE_VA_ARGS_MACRO
|
||||
# define gc_report(level, objspace, ...) \
|
||||
if ((level) > RGENGC_DEBUG) {} else gc_report_body(level, objspace, __VA_ARGS__)
|
||||
if (!RGENGC_DEBUG_ENABLED(level)) {} else gc_report_body(level, objspace, __VA_ARGS__)
|
||||
#else
|
||||
# define gc_report if (!(RGENGC_DEBUG)) {} else gc_report_body
|
||||
# define gc_report if (!RGENGC_DEBUG_ENABLED(0)) {} else gc_report_body
|
||||
#endif
|
||||
PRINTF_ARGS(static void gc_report_body(int level, rb_objspace_t *objspace, const char *fmt, ...), 3, 4);
|
||||
static const char *obj_info(VALUE obj);
|
||||
|
|
Загрузка…
Ссылка в новой задаче