Deduplicate RGENGC_CHECK_MODE into gc/gc.h
This commit is contained in:
parent
2610bf01b2
commit
bf8a8820ba
Notes:
git
2024-10-02 15:48:02 +00:00
4
gc.c
4
gc.c
@ -354,10 +354,6 @@ void rb_vm_update_references(void *ptr);
|
|||||||
int ruby_gc_debug_indent = 0;
|
int ruby_gc_debug_indent = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RGENGC_CHECK_MODE
|
|
||||||
# define RGENGC_CHECK_MODE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef RGENGC_OBJ_INFO
|
#ifndef RGENGC_OBJ_INFO
|
||||||
# define RGENGC_OBJ_INFO RGENGC_CHECK_MODE
|
# define RGENGC_OBJ_INFO RGENGC_CHECK_MODE
|
||||||
#endif
|
#endif
|
||||||
|
12
gc/default.c
12
gc/default.c
@ -236,18 +236,6 @@ static ruby_gc_params_t gc_params = {
|
|||||||
#endif
|
#endif
|
||||||
int ruby_rgengc_debug;
|
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
|
/* RGENGC_PROFILE
|
||||||
* 0: disable RGenGC profiling
|
* 0: disable RGenGC profiling
|
||||||
* 1: enable profiling for basic information
|
* 1: enable profiling for basic information
|
||||||
|
12
gc/gc.h
12
gc/gc.h
@ -49,6 +49,18 @@ void rb_ractor_finish_marking(void);
|
|||||||
// -------------------Private section begin------------------------
|
// -------------------Private section begin------------------------
|
||||||
// Functions in this section are private to the default GC and gc.c
|
// 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
|
#ifndef GC_ASSERT
|
||||||
# define GC_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RGENGC_CHECK_MODE > 0, expr, #expr)
|
# define GC_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RGENGC_CHECK_MODE > 0, expr, #expr)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user