Skip to content

Commit 0e86b49

Browse files
Ahmad-S792Ahmad Saleem
authored andcommitted
Reduce VTTCue size by regrouping m_displayDirection with adjacent small enums
https://bugs.webkit.org/show_bug.cgi?id=319026 rdar://181880375 Reviewed by Eric Carlson. m_displayDirection (CSSValueID, a uint16_t enum) was declared immediately before the double m_displaySize. Sitting on an 8-byte-aligned offset, its 2 bytes forced 6 bytes of padding before the double, wasting a full word. Move it up next to m_writingDirection and m_cueAlignment (both 1-byte enums), which already left 6 bytes of padding before the following RefPtr<VTTRegion>. The enum now folds into that existing hole at no cost, and m_displaySize leads its group without a preceding gap. This shrinks the object by 8 bytes with no behavioral change. * Source/WebCore/html/track/VTTCue.h: Canonical link: https://commits.webkit.org/316950@main
1 parent 7a06e8a commit 0e86b49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Source/WebCore/html/track/VTTCue.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (C) 2011, 2013 Google Inc. All rights reserved.
3-
* Copyright (C) 2012-2023 Apple Inc. All rights reserved.
3+
* Copyright (C) 2012-2026 Apple Inc. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are
@@ -273,6 +273,7 @@ class VTTCue
273273

274274
DirectionSetting m_writingDirection { DirectionSetting::Horizontal };
275275
AlignSetting m_cueAlignment { AlignSetting::Center };
276+
CSSValueID m_displayDirection { CSSValueLtr };
276277

277278
RefPtr<VTTRegion> m_region;
278279
String m_parsedRegionId;
@@ -286,7 +287,6 @@ class VTTCue
286287
RefPtr<SpeechSynthesisUtterance> m_speechUtterance;
287288
#endif
288289

289-
CSSValueID m_displayDirection { CSSValueLtr };
290290
double m_displaySize { 0 };
291291
DisplayPosition m_displayPosition;
292292

0 commit comments

Comments
 (0)