Closed Bug 1258924 Opened 4 years ago Closed 4 years ago

Reorder DOMIfaceAndProtoJSClass fields to reduce padding

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: njn, Assigned: njn)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

DOMIfaceAndProtoJSClass is not optimally packed.
Comment on attachment 8733672 [details] [diff] [review]
Reorder DOMIfaceAndProtoJSClass fields to reduce padding

> +        enumstr = comment + 'enum %s : uint16_t\n{\n%s\n};\n' % (enumName, ',\n'.join(entries))

I was a bit worried about the enums overflowing here as we add more things to the web platform, but looks like that results in a compile error, right?

r=me
Attachment #8733672 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bz] from comment #2)
> 
> > +        enumstr = comment + 'enum %s : uint16_t\n{\n%s\n};\n' % (enumName, ',\n'.join(entries))
> 
> I was a bit worried about the enums overflowing here as we add more things
> to the web platform, but looks like that results in a compile error, right?

Yes. GCC says something like "error: enumerator value <X> is outside the range of underlying type". And we currently have a maximum value of less than 900, so there's plenty of room to grow :)
https://hg.mozilla.org/mozilla-central/rev/edba1116e87e
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.