ipdl compiler should order members to avoid holes on 64-bit platforms

RESOLVED FIXED in mozilla14

Status

()

Core
IPC
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

(Blocks: 1 bug)

unspecified
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Most of our ipdl-generated classes have a member layout like so:

    Channel* mChannel;
    int32 mId;
    mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
    State mState;

As bug 492185 pointed out, this layout produces two 4-byte "holes" on 64-bit platforms, one after mId and one after mState.

We should be smarter about laying out the members.  We won't be able to pack all the holes all the time, but we can get the common cases right.
(Assignee)

Comment 1

5 years ago
Created attachment 615380 [details] [diff] [review]
patch

Like this.

I don't think we can do much with the other two cases, but judging by the generated headers, this is the only case that really matters.
Attachment #615380 - Flags: review?(jones.chris.g)
Attachment #615380 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d345cf4616b
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/2d345cf4616b
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.