diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-09-09 23:21:06 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-09-11 08:41:32 +0900 |
commit | cd829bb078e6a3486d9b5ea57fc5111d289c1860 (patch) | |
tree | f1c903880d0ed454250f95d95a6e6d765a899796 /vm.c | |
parent | 967b9743faac0b55a3d8deb176a08fdff449bba8 (diff) |
Remove printf family from the mjit header
Linking printf family functions makes mjit objects to link
unnecessary code.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4820
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -315,10 +315,10 @@ rb_vm_cref_new_toplevel(void) static void vm_cref_dump(const char *mesg, const rb_cref_t *cref) { - fprintf(stderr, "vm_cref_dump: %s (%p)\n", mesg, (void *)cref); + ruby_debug_printf("vm_cref_dump: %s (%p)\n", mesg, (void *)cref); while (cref) { - fprintf(stderr, "= cref| klass: %s\n", RSTRING_PTR(rb_class_path(CREF_CLASS(cref)))); + ruby_debug_printf("= cref| klass: %s\n", RSTRING_PTR(rb_class_path(CREF_CLASS(cref)))); cref = CREF_NEXT(cref); } } @@ -686,15 +686,15 @@ static VALUE check_env_value(const rb_env_t *env); static int check_env(const rb_env_t *env) { - fprintf(stderr, "---\n"); - fprintf(stderr, "envptr: %p\n", (void *)&env->ep[0]); - fprintf(stderr, "envval: %10p ", (void *)env->ep[1]); + fputs("---\n", stderr); + ruby_debug_printf("envptr: %p\n", (void *)&env->ep[0]); + ruby_debug_printf("envval: %10p ", (void *)env->ep[1]); dp(env->ep[1]); - fprintf(stderr, "ep: %10p\n", (void *)env->ep); + ruby_debug_printf("ep: %10p\n", (void *)env->ep); if (rb_vm_env_prev_env(env)) { - fprintf(stderr, ">>\n"); + fputs(">>\n", stderr); check_env_value(rb_vm_env_prev_env(env)); - fprintf(stderr, "<<\n"); + fputs("<<\n", stderr); } return 1; } @@ -2719,7 +2719,7 @@ get_param(const char *name, size_t default_value, size_t min_value) } result = (size_t)(((val -1 + RUBY_VM_SIZE_ALIGN) / RUBY_VM_SIZE_ALIGN) * RUBY_VM_SIZE_ALIGN); } - if (0) fprintf(stderr, "%s: %"PRIuSIZE"\n", name, result); /* debug print */ + if (0) ruby_debug_printf("%s: %"PRIuSIZE"\n", name, result); /* debug print */ return result; } @@ -3706,7 +3706,7 @@ Init_BareVM(void) rb_vm_t * vm = ruby_mimmalloc(sizeof(*vm)); rb_thread_t * th = ruby_mimmalloc(sizeof(*th)); if (!vm || !th) { - fprintf(stderr, "[FATAL] failed to allocate memory\n"); + fputs("[FATAL] failed to allocate memory\n", stderr); exit(EXIT_FAILURE); } MEMZERO(th, rb_thread_t, 1); |