mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Replace the lazy_static crate whth std::sync::LazyLock
in components/script (#33004)
* replace in str.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace navigator.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace htmlmetaelement.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace document.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace cssstyledeclaration.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace script_runtime.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace window_named_properties.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce dependency lazy_static Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce lazy in script_runtime.rs `Mutex::new()` is const contexts. I think that `JS_ENGINE` is need not lazy initialize. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
f38d1574bc
commit
a797969efe
9 changed files with 98 additions and 104 deletions
|
@ -47,7 +47,6 @@ use js::rust::{
|
|||
describe_scripted_caller, Handle, HandleObject as RustHandleObject, IntoHandle, JSEngine,
|
||||
JSEngineHandle, ParentRuntime, Runtime as RustRuntime,
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
use malloc_size_of::MallocSizeOfOps;
|
||||
use profile_traits::mem::{Report, ReportKind, ReportsChan};
|
||||
use profile_traits::path;
|
||||
|
@ -487,9 +486,7 @@ impl Drop for JSEngineSetup {
|
|||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref JS_ENGINE: Mutex<Option<JSEngineHandle>> = Mutex::new(None);
|
||||
}
|
||||
static JS_ENGINE: Mutex<Option<JSEngineHandle>> = Mutex::new(None);
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn new_child_runtime(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue