Closed Bug 717311 Opened 14 years ago Closed 14 years ago

gfxUnicodePropertyData.cpp:sCatEAWValues takes up more space than it should

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file, 1 obsolete file)

gfxUnicodePropertyData.cpp:sCatEAWValues is an array of: struct { unsigned int mEAW:3; unsigned int mCategory:5; } Unfortunately, this actually winds up wasting space because of structure padding inserted to maintain alignment. Patch coming up.
Attached patch pack bits manually (obsolete) — Splinter Review
Instead of using a structure with bitfields, pack things manually. Saves a little over 70K of data.
Attachment #587753 - Flags: review?(jfkthame)
Hmm... you're right, it does end up wasting space. :( However, wouldn't a simpler patch be to declare the fields as unsigned char (with the appropriate field widths)? That would avoid the need for manually packing/unpacking the fields, which just makes the code more opaque.
Indeed, that works just as well and produces a much smaller patch. :)
Attachment #587753 - Attachment is obsolete: true
Attachment #587753 - Flags: review?(jfkthame)
Attachment #587875 - Flags: review?(jfkthame)
Comment on attachment 587875 [details] [diff] [review] change bitfield datatype Great, let's go with this - thanks.
Attachment #587875 - Flags: review?(jfkthame) → review+
Keywords: checkin-needed
Target Milestone: mozilla12 → ---
Re-landed on inbound, as this wasn't responsible for the problems on the previous push: https://hg.mozilla.org/integration/mozilla-inbound/rev/9e52edb8a534
Target Milestone: --- → mozilla12
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: