Last Comment Bug 745758 - ipdl compiler should order members to avoid holes on 64-bit platforms
: ipdl compiler should order members to avoid holes on 64-bit platforms
Product: Core
Classification: Components
Component: IPC (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla14
Assigned To: Nathan Froyd [:froydnj]
: Bill McCloskey (:billm)
Depends on:
Blocks: 492185
  Show dependency treegraph
Reported: 2012-04-16 08:31 PDT by Nathan Froyd [:froydnj]
Modified: 2012-04-18 05:27 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.36 KB, patch)
2012-04-16 10:33 PDT, Nathan Froyd [:froydnj]
cjones.bugs: review+
Details | Diff | Splinter Review

Description User image Nathan Froyd [:froydnj] 2012-04-16 08:31:10 PDT
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.
Comment 1 User image Nathan Froyd [:froydnj] 2012-04-16 10:33:12 PDT
Created attachment 615380 [details] [diff] [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.
Comment 3 User image Marco Bonardo [::mak] 2012-04-18 05:27:17 PDT

Note You need to log in before you can comment on or make changes to this bug.