diff --git a/Cargo.lock b/Cargo.lock index fb5da691f..ff4ce4ad2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "gc-arena" version = "0.2.2" -source = "git+https://github.com/ruffle-rs/gc-arena#24d8aea5f0fd968756d6e3c1dac4c6c2ccb7280a" +source = "git+https://github.com/kyren/gc-arena?rev=318b2ea594dcdadd01f7789025e3b3940be96b2c#318b2ea594dcdadd01f7789025e3b3940be96b2c" dependencies = [ "gc-arena-derive", ] @@ -1678,7 +1678,7 @@ dependencies = [ [[package]] name = "gc-arena-derive" version = "0.2.2" -source = "git+https://github.com/ruffle-rs/gc-arena#24d8aea5f0fd968756d6e3c1dac4c6c2ccb7280a" +source = "git+https://github.com/kyren/gc-arena?rev=318b2ea594dcdadd01f7789025e3b3940be96b2c#318b2ea594dcdadd01f7789025e3b3940be96b2c" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 73390db47..abf9f20e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,9 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/ruffle-rs/ruffle" version = "0.1.0" +[workspace.dependencies] +gc-arena = { git = "https://github.com/kyren/gc-arena", rev = "318b2ea594dcdadd01f7789025e3b3940be96b2c" } + # Don't optimize build scripts and macros. [profile.release.build-override] opt-level = 0 diff --git a/core/Cargo.toml b/core/Cargo.toml index 83317d2f9..343b206bb 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -12,7 +12,7 @@ byteorder = "1.4" bitstream-io = "1.6.0" flate2 = "1.0.25" fnv = "1.0.7" -gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" } +gc-arena = { workspace = true } generational-arena = "0.2.8" indexmap = "1.9.2" tracing = "0.1.37" diff --git a/core/src/avm1/function.rs b/core/src/avm1/function.rs index 21ebb95ac..48aad3809 100644 --- a/core/src/avm1/function.rs +++ b/core/src/avm1/function.rs @@ -308,7 +308,10 @@ impl fmt::Debug for Executable<'_> { .debug_tuple("Executable::Native") .field(&format!("{nf:p}")) .finish(), - Executable::Action(af) => f.debug_tuple("Executable::Action").field(&af).finish(), + Executable::Action(af) => f + .debug_tuple("Executable::Action") + .field(&Gc::as_ptr(*af)) + .finish(), } } } diff --git a/core/src/avm2/function.rs b/core/src/avm2/function.rs index 60b4b5f55..f2053f48e 100644 --- a/core/src/avm2/function.rs +++ b/core/src/avm2/function.rs @@ -288,7 +288,7 @@ impl<'gc> fmt::Debug for Executable<'gc> { match self { Self::Action(be) => fmt .debug_struct("Executable::Action") - .field("method", &be.method) + .field("method", &Gc::as_ptr(be.method)) .field("scope", &be.scope) .field("receiver", &be.receiver) .finish(), diff --git a/core/src/avm2/scope.rs b/core/src/avm2/scope.rs index 3c4572333..c356488a6 100644 --- a/core/src/avm2/scope.rs +++ b/core/src/avm2/scope.rs @@ -11,7 +11,7 @@ use gc_arena::{Collect, Gc, MutationContext}; use std::ops::Deref; /// Represents a Scope that can be on either a ScopeChain or local ScopeStack. -#[derive(Collect, Clone, Copy)] +#[derive(Collect, Clone, Copy, Debug)] #[collect(no_drop)] pub struct Scope<'gc> { /// The underlying object of this Scope diff --git a/core/src/player.rs b/core/src/player.rs index 67b2dcda5..1654c1880 100644 --- a/core/src/player.rs +++ b/core/src/player.rs @@ -40,7 +40,7 @@ use crate::string::AvmString; use crate::tag_utils::SwfMovie; use crate::timer::Timers; use crate::vminterface::Instantiator; -use gc_arena::{make_arena, ArenaParameters, Collect, GcCell}; +use gc_arena::{ArenaParameters, Collect, GcCell}; use instant::Instant; use rand::{rngs::SmallRng, SeedableRng}; use ruffle_render::backend::{null::NullRenderer, RenderBackend, ViewportDimensions}; @@ -188,7 +188,7 @@ impl<'gc> GcRootData<'gc> { } } -make_arena!(GcArena, GcRoot); +type GcArena = gc_arena::Arena]>; type Audio = Box; type Navigator = Box; diff --git a/render/Cargo.toml b/render/Cargo.toml index cbea53ae1..c1dcf451e 100644 --- a/render/Cargo.toml +++ b/render/Cargo.toml @@ -18,7 +18,7 @@ downcast-rs = "1.2.0" lyon = { version = "1.0.1", optional = true } thiserror = "1.0" wasm-bindgen = { version = "=0.2.83", optional = true } -gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" } +gc-arena = { workspace = true } enum-map = "2.4.2" [dependencies.jpeg-decoder] diff --git a/render/canvas/Cargo.toml b/render/canvas/Cargo.toml index f30b17ce1..c0c1b6dd7 100644 --- a/render/canvas/Cargo.toml +++ b/render/canvas/Cargo.toml @@ -14,7 +14,7 @@ ruffle_web_common = { path = "../../web/common" } wasm-bindgen = "=0.2.83" fnv = "1.0.7" ruffle_render = { path = "..", features = ["web"] } -gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" } +gc-arena = { workspace = true } swf = { path = "../../swf" } downcast-rs = "1.2.0" diff --git a/render/webgl/Cargo.toml b/render/webgl/Cargo.toml index ac2e9e4cf..72e8ebfe3 100644 --- a/render/webgl/Cargo.toml +++ b/render/webgl/Cargo.toml @@ -14,7 +14,7 @@ ruffle_web_common = { path = "../../web/common" } ruffle_render = { path = "..", features = ["tessellator", "web"] } wasm-bindgen = "=0.2.83" bytemuck = { version = "1.12.3", features = ["derive"] } -gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" } +gc-arena = { workspace = true } fnv = "1.0.7" swf = { path = "../../swf" } thiserror = "1.0" diff --git a/render/wgpu/Cargo.toml b/render/wgpu/Cargo.toml index 18a7b04c4..d1c90afb6 100644 --- a/render/wgpu/Cargo.toml +++ b/render/wgpu/Cargo.toml @@ -21,7 +21,7 @@ image = { version = "0.24.5", default-features = false } ouroboros = "0.15.5" typed-arena = "2.0.1" once_cell = "1.17.0" -gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" } +gc-arena = { workspace = true } naga-agal = { path = "../naga-agal" } downcast-rs = "1.2.0"