The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla12

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
Created attachment 587753 [details] [diff] [review]
pack bits manually

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.
(Assignee)

Comment 3

5 years ago
Created attachment 587875 [details] [diff] [review]
change bitfield datatype

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+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/6bf51f18e69e
Keywords: checkin-needed
Target Milestone: --- → mozilla12
Backed out of inbound, since that push caused test crashes, though presumably just bug 708075:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=f94f83c7f2df

https://hg.mozilla.org/integration/mozilla-inbound/rev/76fc8cdd2a31
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
https://hg.mozilla.org/mozilla-central/rev/9e52edb8a534
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.