Bug 89112 - Fix bit packing of StyleRareInheritedData on Windows
Summary: Fix bit packing of StyleRareInheritedData on Windows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-14 10:43 PDT by Tony Chang
Modified: 2012-06-14 15:33 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2012-06-14 10:44 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (2.98 KB, patch)
2012-06-14 11:56 PDT, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2012-06-14 10:43:16 PDT
Fix bit packing of StyleRareInheritedData on Windows
Comment 1 Tony Chang 2012-06-14 10:44:27 PDT
Created attachment 147614 [details]
Patch
Comment 2 Ryosuke Niwa 2012-06-14 10:56:10 PDT
Comment on attachment 147614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=147614&action=review

> Source/WebCore/rendering/style/StyleRareInheritedData.cpp:44
> +    unsigned m_bitfields[2];
> +
> +    Color colors[6];
> +    float floats[2];
> +    void* ownPtrs[1];
> +    AtomicString atomicStrings[5];
> +    void* refPtrs[2];
> +    Length lengths[1];
> +    short pagedMediaShorts[2];
> +    unsigned unsigneds[1];
> +    short hyphenationShorts[3];

I would be very careful with the order in which these things appear.
e.g.
unsigned a;
void* b;
unsigned c;
and
unsigned a;
unsigned b;
void* c
will consume a different size on a 64-bit architecture.
Comment 3 Tony Chang 2012-06-14 11:51:23 PDT
(In reply to comment #2)
> (From update of attachment 147614 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=147614&action=review
> 
> > Source/WebCore/rendering/style/StyleRareInheritedData.cpp:44
> > +    unsigned m_bitfields[2];
> > +
> > +    Color colors[6];
> > +    float floats[2];
> > +    void* ownPtrs[1];
> > +    AtomicString atomicStrings[5];
> > +    void* refPtrs[2];
> > +    Length lengths[1];
> > +    short pagedMediaShorts[2];
> > +    unsigned unsigneds[1];
> > +    short hyphenationShorts[3];
> 
> I would be very careful with the order in which these things appear.
> e.g.
> unsigned a;
> void* b;
> unsigned c;
> and
> unsigned a;
> unsigned b;
> void* c
> will consume a different size on a 64-bit architecture.

Hmm, you're right. I think it's an accident that these match. I'm going to reorder the test values.  I bet we can save some memory by reordering some values, but I'll do that in a follow up patch.
Comment 4 Tony Chang 2012-06-14 11:56:40 PDT
Created attachment 147625 [details]
Patch for landing
Comment 5 WebKit Review Bot 2012-06-14 15:33:38 PDT
Comment on attachment 147625 [details]
Patch for landing

Clearing flags on attachment: 147625

Committed r120366: <http://trac.webkit.org/changeset/120366>
Comment 6 WebKit Review Bot 2012-06-14 15:33:42 PDT
All reviewed patches have been landed.  Closing bug.