Skip to content

Commit

Permalink
Removed Transmute in jsgc
Browse files Browse the repository at this point in the history
  • Loading branch information
Redfire75369 committed Dec 2, 2023
1 parent 1e730cb commit 70fce7c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mozjs-sys/src/jsgc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::jsapi::{jsid, JSFunction, JSObject, JSScript, JSString, JSTracer};
use crate::jsid::VoidId;
use std::cell::UnsafeCell;
use std::ffi::c_void;
use std::mem;
use std::ptr;

/// A trait for JS types that can be registered as roots.
Expand Down Expand Up @@ -116,9 +115,9 @@ impl GCMethods for *mut JSFunction {
}
unsafe fn post_barrier(v: *mut *mut JSFunction, prev: *mut JSFunction, next: *mut JSFunction) {
JS::HeapObjectWriteBarriers(
mem::transmute(v),
mem::transmute(prev),
mem::transmute(next),
v as *mut *mut JSObject,
prev as *mut JSObject,
next as *mut JSObject,
);
}
}
Expand Down

0 comments on commit 70fce7c

Please sign in to comment.