Closed
Bug 735439
Opened 13 years ago
Closed 13 years ago
reorder fields in gfxFontStyle for more efficient packing
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(1 file)
|
6.51 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
The attached patch rearranges fields so that sizeof(gfxFontStyle) drops from 48 to 40 bytes on a 64-bit OS X build. Given that we can easily have thousands of gfxFontStyle records alive at any one time, this seems like a worthwhile saving.
Attachment #605533 -
Flags: review?(jdaggett)
Comment 1•13 years ago
|
||
Comment on attachment 605533 [details] [diff] [review]
patch, optimize order of fields in gfxFontStyle to save space
r+ with fix noted below.
> + // The style of font (normal, italic, oblique)
> + PRUint8 style : 6;
This should be 'style : 2', there's no real reason to be doing the
padding ourselves, this leads to bytes inadvertently being added when
new fields are added, as seems to be the case in the original 'style :
7' definition.
Attachment #605533 -
Flags: review?(jdaggett) → review+
| Assignee | ||
Comment 2•13 years ago
|
||
Target Milestone: --- → mozilla14
Comment 3•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 4•13 years ago
|
||
Comment on attachment 605533 [details] [diff] [review]
patch, optimize order of fields in gfxFontStyle to save space
Review of attachment 605533 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxFont.h
@@ +165,5 @@
> + // Say that this font is used for print or print preview.
> + bool printerFont : 1;
> +
> + // The style of font (normal, italic, oblique)
> + PRUint8 style : 6;
Note that MSVC apparently only packs members of the same type.
You need to log in
before you can comment on or make changes to this bug.
Description
•