Skip to content

Commit cdb88d8

Browse files
committed
core: Force correct alignment for DisplayObjectBase
On certain architectures (e.g. 32-bits Android), `f64`s are only 4-aligned, so we need to increase the alignment of `DisplayObjectBase` to always match with its subclasses.
1 parent 2536d46 commit cdb88d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/display_object.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ impl BitmapCache {
192192

193193
#[derive(Clone, Collect)]
194194
#[collect(no_drop)]
195+
// Ensure this always has the same alignment as its subclasses (needed for `Gc` casts).
196+
#[repr(align(8))]
195197
pub struct DisplayObjectBase<'gc> {
196198
cell: RefCell<DisplayObjectBaseMut>,
197199
parent: Lock<Option<DisplayObject<'gc>>>,

0 commit comments

Comments
 (0)