Closed Bug 1353618 Opened 7 years ago Closed 7 years ago

Optimize storage of MozPromise::mThenValues

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox53 --- wontfix
firefox54 --- fixed
firefox55 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

Details

Attachments

(1 file)

http://searchfox.org/mozilla-central/rev/381a7b8f8a78b481336cfa384cb0a5536e217e4a/xpcom/threads/MozPromise.h#929

There should be at most only one element in the array when IsExclusive is true. We can use AutoTArray<RefPtr<ThenValueBase>,1> for more efficient storage and avoid indirect heap allocation incurred by nsTArray<>.
Attachment #8854726 - Flags: review?(gsquelart)
Assignee: nobody → jwwang
Comment on attachment 8854726 [details]
Bug 1353618 - Optimize storage of MozPromise::mThenValues.

https://reviewboard.mozilla.org/r/126684/#review129310
Attachment #8854726 - Flags: review?(gsquelart) → review+
Thanks!
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/07c96da52366
Optimize storage of MozPromise::mThenValues. r=gerald
https://hg.mozilla.org/mozilla-central/rev/07c96da52366
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment on attachment 8854726 [details]
Bug 1353618 - Optimize storage of MozPromise::mThenValues.

Approval Request Comment
[Feature/Bug causing the regression]:none
[User impact if declined]:This patch changes the memory allocation pattern for MozPromise which might provide more clues when debugging memory corruption in MozPromise.
[Is this code covered by automated tests?]:yes
[Has the fix been verified in Nightly?]:yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]:none
[Is the change risky?]:no
[Why is the change risky/not risky?]:this is a simple one-line change.
[String changes made/needed]:none
Attachment #8854726 - Flags: approval-mozilla-beta?
Attachment #8854726 - Flags: approval-mozilla-aurora?
Comment on attachment 8854726 [details]
Bug 1353618 - Optimize storage of MozPromise::mThenValues.

This is for debugging purpose. I don't think we need this in Beta53 given next week is RC week but we can take it in aurora. Aurora54+.
Attachment #8854726 - Flags: approval-mozilla-beta?
Attachment #8854726 - Flags: approval-mozilla-beta-
Attachment #8854726 - Flags: approval-mozilla-aurora?
Attachment #8854726 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: