From 6844bcc6b4cdc50def1c0d30d4e8b5045fb43443 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 27 Nov 2022 15:15:52 -0800 Subject: MJIT: Use a String buffer in builtin compilers instead of FILE*. Using C.fprintf is slower than String manipulation on memory. I'm going to change the way MJIT writes files, and this is a prerequisite for it. --- yjit/src/cruby.rs | 7 ------- yjit/src/cruby_bindings.inc.rs | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'yjit/src') diff --git a/yjit/src/cruby.rs b/yjit/src/cruby.rs index d37af38320..229cfa109e 100644 --- a/yjit/src/cruby.rs +++ b/yjit/src/cruby.rs @@ -270,13 +270,6 @@ pub struct rb_method_cfunc_t { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -/// Opaque FILE type from the C standard library -#[repr(C)] -pub struct FILE { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - /// Opaque call-cache type from vm_callinfo.h #[repr(C)] pub struct rb_callcache { diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index 78967cd4ce..ea57bd69d8 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -1047,7 +1047,7 @@ pub struct rb_builtin_function { pub name: *const ::std::os::raw::c_char, pub compiler: ::std::option::Option< unsafe extern "C" fn( - arg1: *mut FILE, + arg1: VALUE, arg2: ::std::os::raw::c_long, arg3: ::std::os::raw::c_uint, arg4: bool, -- cgit v1.2.3