diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-10-02 09:58:58 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2024-10-02 11:47:45 -0400 |
| commit | bf8a8820baeff59d507ce7d32a2f52e46500733f (patch) | |
| tree | 8a5fe822392d81f54fa1ad0f5283d5a13646d35a | |
| parent | 2610bf01b26b437df6a3634ffb7629b83ea57e17 (diff) | |
Deduplicate RGENGC_CHECK_MODE into gc/gc.h
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11764
| -rw-r--r-- | gc.c | 4 | ||||
| -rw-r--r-- | gc/default.c | 12 | ||||
| -rw-r--r-- | gc/gc.h | 12 |
3 files changed, 12 insertions, 16 deletions
@@ -354,10 +354,6 @@ void rb_vm_update_references(void *ptr); int ruby_gc_debug_indent = 0; #endif -#ifndef RGENGC_CHECK_MODE -# define RGENGC_CHECK_MODE 0 -#endif - #ifndef RGENGC_OBJ_INFO # define RGENGC_OBJ_INFO RGENGC_CHECK_MODE #endif diff --git a/gc/default.c b/gc/default.c index 01021b7277..e1f30f1067 100644 --- a/gc/default.c +++ b/gc/default.c @@ -236,18 +236,6 @@ static ruby_gc_params_t gc_params = { #endif int ruby_rgengc_debug; -/* RGENGC_CHECK_MODE - * 0: disable all assertions - * 1: enable assertions (to debug RGenGC) - * 2: enable internal consistency check at each GC (for debugging) - * 3: enable internal consistency check at each GC steps (for debugging) - * 4: enable liveness check - * 5: show all references - */ -#ifndef RGENGC_CHECK_MODE -# define RGENGC_CHECK_MODE 0 -#endif - /* RGENGC_PROFILE * 0: disable RGenGC profiling * 1: enable profiling for basic information @@ -49,6 +49,18 @@ void rb_ractor_finish_marking(void); // -------------------Private section begin------------------------ // Functions in this section are private to the default GC and gc.c +/* RGENGC_CHECK_MODE + * 0: disable all assertions + * 1: enable assertions (to debug RGenGC) + * 2: enable internal consistency check at each GC (for debugging) + * 3: enable internal consistency check at each GC steps (for debugging) + * 4: enable liveness check + * 5: show all references + */ +#ifndef RGENGC_CHECK_MODE +# define RGENGC_CHECK_MODE 0 +#endif + #ifndef GC_ASSERT # define GC_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RGENGC_CHECK_MODE > 0, expr, #expr) #endif |
