Closed Bug 745758 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: froydnj, Assigned: froydnj)

References

Details

Attachments

(1 file)

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.
Attached patch patchSplinter Review
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+
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
Closed: 12 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: