Skip to content

Commit

Permalink
YJIT: Constify EC to avoid an as pointer cast (#7591)
Browse files Browse the repository at this point in the history
  • Loading branch information
XrXr committed Mar 24, 2023
1 parent 7149f57 commit 35e9b53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yjit.c
Expand Up @@ -335,7 +335,7 @@ rb_yjit_reserve_addr_space(uint32_t mem_size)

// Is anyone listening for :c_call and :c_return event currently?
bool
rb_c_method_tracing_currently_enabled(rb_execution_context_t *ec)
rb_c_method_tracing_currently_enabled(const rb_execution_context_t *ec)
{
rb_event_flag_t tracing_events;
if (rb_multi_ractor_p()) {
Expand Down
2 changes: 1 addition & 1 deletion yjit/src/codegen.rs
Expand Up @@ -4712,7 +4712,7 @@ fn lookup_cfunc_codegen(def: *const rb_method_definition_t) -> Option<MethodGenF
fn c_method_tracing_currently_enabled(jit: &JITState) -> bool {
// Defer to C implementation in yjit.c
unsafe {
rb_c_method_tracing_currently_enabled(jit.ec as *mut rb_execution_context_struct)
rb_c_method_tracing_currently_enabled(jit.ec)
}
}

Expand Down
2 changes: 1 addition & 1 deletion yjit/src/cruby_bindings.inc.rs
Expand Up @@ -1210,7 +1210,7 @@ extern "C" {
) -> VALUE;
pub fn rb_yjit_get_page_size() -> u32;
pub fn rb_yjit_reserve_addr_space(mem_size: u32) -> *mut u8;
pub fn rb_c_method_tracing_currently_enabled(ec: *mut rb_execution_context_t) -> bool;
pub fn rb_c_method_tracing_currently_enabled(ec: *const rb_execution_context_t) -> bool;
pub fn rb_full_cfunc_return(ec: *mut rb_execution_context_t, return_value: VALUE);
pub fn rb_iseq_encoded_size(iseq: *const rb_iseq_t) -> ::std::os::raw::c_uint;
pub fn rb_iseq_get_yjit_payload(iseq: *const rb_iseq_t) -> *mut ::std::os::raw::c_void;
Expand Down

0 comments on commit 35e9b53

Please sign in to comment.