Closed Bug 1401662 Opened 8 years ago Closed 8 years ago

don't inline nsThreadManager::get()

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

Defining get() in the declaration of nsThreadManager implicitly sticks an "inline" on the function, which is not what we want: inlining it spreads around a lot of static initialization code. Providing an out-of-line definition is much better in terms of code size.
Small codesize win.
Attachment #8910410 - Flags: review?(erahm)
Comment on attachment 8910410 [details] [diff] [review] don't inline nsThreadManager::get() Review of attachment 8910410 [details] [diff] [review]: ----------------------------------------------------------------- I imagine this is a pretty common pattern, should we look for other instances of this?
Attachment #8910410 - Flags: review?(erahm) → review+
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a88ee0137c10 don't inline nsThreadManager::get(); r=erahm
That's an excellent idea; a quick grep shows a couple of other instances of things like this. Will file bugs tomorrow.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: