Skip to content

core: Remove GcCell usage in MovieClipShared #20310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 27, 2025

Conversation

moulins
Copy link
Contributor

@moulins moulins commented Apr 30, 2025

Additionally, preloading now modifies the existing MovieClipShared instance instead of swapping a clone on each preload call.

This means that duplicating a partially-preloaded MovieClip will return a clip sharing the preload state. This seems "more correct" to me (as it means that both clips will properly finish preloading), but I haven't tested this in FP.

EDIT: Added a further refactoring that moves most of the tag preloading methods to MovieClipShared, as they mostly don't need access to the actual MC instance.

@moulins moulins force-pushed the cell-movie-clip-shared branch from c6278e2 to dd01076 Compare April 30, 2025 01:20
@moulins moulins added A-core Area: Core player, where no other category fits T-refactor Type: Refactor / Cleanup waiting-on-review Waiting on review from a Ruffle team member labels Apr 30, 2025
@moulins moulins force-pushed the cell-movie-clip-shared branch 2 times, most recently from c3789d5 to 6ec740c Compare April 30, 2025 23:07
@moulins moulins removed the waiting-on-review Waiting on review from a Ruffle team member label May 2, 2025
@moulins moulins force-pushed the cell-movie-clip-shared branch 2 times, most recently from 237a074 to 201d0a0 Compare May 2, 2025 23:04
@moulins moulins added the waiting-on-review Waiting on review from a Ruffle team member label May 2, 2025
@moulins moulins force-pushed the cell-movie-clip-shared branch 5 times, most recently from 772b382 to 929d059 Compare May 10, 2025 11:23
@moulins moulins force-pushed the cell-movie-clip-shared branch 2 times, most recently from 0e1a193 to 1a01fa8 Compare May 17, 2025 14:01
@moulins moulins force-pushed the cell-movie-clip-shared branch from 1a01fa8 to 46e6262 Compare May 22, 2025 13:32
Copy link
Member

@kjarosh kjarosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@moulins moulins force-pushed the cell-movie-clip-shared branch from 46e6262 to 8462b55 Compare May 27, 2025 00:34
moulins added 4 commits May 27, 2025 02:35
And refactor movieclip preloading logic by segregating mutable data into a
separate GC-agnostic `MovieClipSharedMut` struct.

This allows the removal of the convoluted static data cloning logic in
`MovieClip::preload`.
Most of these do not need access to an actual MC instance; the only hold-out
is AVM1's `do_init_action`.
@moulins moulins force-pushed the cell-movie-clip-shared branch from 8462b55 to 3275ef3 Compare May 27, 2025 00:35
@moulins moulins merged commit 33d71d5 into ruffle-rs:master May 27, 2025
22 checks passed
@moulins moulins deleted the cell-movie-clip-shared branch May 27, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core player, where no other category fits T-refactor Type: Refactor / Cleanup waiting-on-review Waiting on review from a Ruffle team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants