From cd829bb078e6a3486d9b5ea57fc5111d289c1860 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 Sep 2021 23:21:06 +0900 Subject: Remove printf family from the mjit header Linking printf family functions makes mjit objects to link unnecessary code. --- vm_exec.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'vm_exec.h') diff --git a/vm_exec.h b/vm_exec.h index 10434fc37d..89c925cbb4 100644 --- a/vm_exec.h +++ b/vm_exec.h @@ -37,8 +37,8 @@ typedef rb_iseq_t *ISEQ; #define DEBUG_END_INSN() #endif -#define throwdebug if(0)printf -/* #define throwdebug printf */ +#define throwdebug if(0)ruby_debug_printf +/* #define throwdebug ruby_debug_printf */ #ifndef USE_INSNS_COUNTER #define USE_INSNS_COUNTER 0 @@ -74,11 +74,13 @@ error ! #define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x)) #define INSN_ENTRY_SIG(insn) \ - if (0) fprintf(stderr, "exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \ - (reg_pc - reg_cfp->iseq->body->iseq_encoded), \ - (reg_cfp->pc - reg_cfp->iseq->body->iseq_encoded), \ - RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \ - rb_iseq_line_no(reg_cfp->iseq, reg_pc - reg_cfp->iseq->body->iseq_encoded)); \ + if (0) { \ + ruby_debug_printf("exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \ + (reg_pc - reg_cfp->iseq->body->iseq_encoded), \ + (reg_cfp->pc - reg_cfp->iseq->body->iseq_encoded), \ + RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \ + rb_iseq_line_no(reg_cfp->iseq, reg_pc - reg_cfp->iseq->body->iseq_encoded)); \ + } \ if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn)); #define INSN_DISPATCH_SIG(insn) -- cgit v1.2.1