Closed Bug 1113010 Opened 6 years ago Closed 6 years ago

FrameConstructionItem has excess padding

Categories

(Core :: Layout, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: njn, Assigned: njn)

References

Details

Attachments

(3 files, 1 obsolete file)

FrameConstructionItem's fields can be fiddled with so that it takes up less space.
Infallible new ensures that |item| is always non-null. And even if it didn't,
AppendItem() dereferences |item| before this code is reached.
Attachment #8538277 - Flags: review?(dholbert)
This reduces its size from 176 bytes to 168 bytes on 64-bit platforms.
Attachment #8538280 - Flags: review?(dholbert)
Whoops, forgot to move one field.
Attachment #8538281 - Flags: review?(dholbert)
Attachment #8538280 - Attachment is obsolete: true
Attachment #8538280 - Flags: review?(dholbert)
This reduces its size from 168 bytes to 160 bytes on 64-bit platforms.
Attachment #8538282 - Flags: review?(dholbert)
BTW, my attention was drawn to this because DMD finds that we can quickly create 100s of 1000s of these on some workloads.
Comment on attachment 8538277 [details] [diff] [review]
(part 0) - Remove impossible path in AddFrameConstruct()

># HG changeset patch
># User Nicholas Nethercote <nnethercote@mozilla.com>
># Date 1418879112 28800
>#      Wed Dec 17 21:05:12 2014 -0800
># Node ID f088c343e75d1b372251dbee02e2fde49938daad
># Parent  03dbab1eeb4e3f99672a174277ba634a39a98292
>Bug 1113010 (part 0) - Remove impossible path in AddFrameConstruct().

Please add documentation to AppendItem(), indicating that it's guaranteed to return non-null, due to infallible 'new'.

r=me with that.
Attachment #8538277 - Flags: review?(dholbert) → review+
Attachment #8538281 - Flags: review?(dholbert) → review+
Attachment #8538282 - Flags: review?(dholbert) → review+
You need to log in before you can comment on or make changes to this bug.