From 0f99322f27338d759b86551363a7275e53627a72 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Mon, 7 Jan 2013 15:28:05 +0900 Subject: gc.c: Enable DEBUG(x) if GC_DEBUG is defined. vm.c: Enable DEBUG(x) if VM_DEBUG is defined. --- src/gc.c | 2 ++ src/vm.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gc.c b/src/gc.c index 472535925..816f258ad 100644 --- a/src/gc.c +++ b/src/gc.c @@ -147,8 +147,10 @@ gettimeofday_time(void) #ifdef GC_DEBUG #include #define gc_assert(expect) assert(expect) +#define DEBUG(x) (x) #else #define gc_assert(expect) ((void)0) +#define DEBUG(x) #endif #define GC_STEP_SIZE 1024 diff --git a/src/vm.c b/src/vm.c index b84158d1d..8ae28ef5e 100644 --- a/src/vm.c +++ b/src/vm.c @@ -49,7 +49,11 @@ The value below allows about 60000 recursive calls in the simplest case. */ #define MRB_STACK_MAX ((1<<18) - MRB_STACK_GROWTH) #endif - +#ifdef VM_DEBUG +# define DEBUG(x) (x) +#else +# define DEBUG(x) +#endif static inline void stack_copy(mrb_value *dst, const mrb_value *src, size_t size) -- cgit v1.2.3