Closed Bug 1292301 Opened 4 years ago Closed 4 years ago

reduce reference counting in Places

Categories

(Toolkit :: Places, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

Just a few optimizations I noticed.
By using nsCOMArray::Forget, we can pass the references we hold in an
nsCOMArray directly to the XPCOM caller, without having to go through an
extra cycle of AddRef/Release calls.  This way should be slightly faster
and it also results in smaller code.  Notice that we don't have to worry
about removing the OOM check in the places that use Forget(), because we
were already using moz_xmalloc to allocate the outparam array, and
moz_xmalloc aborts the process on OOM, just as Forget() does.

The nsNavHistoryFolderResultNode::GetQueries change is thrown in for fun.

Drew, Marco is going on PTO soon and volunteered your help for places in
another bug, which makes me assume that you can review this code?
Attachment #8777928 - Flags: review?(adw)
Comment on attachment 8777928 [details] [diff] [review]
reduce reference-counting in Places

Review of attachment 8777928 [details] [diff] [review]:
-----------------------------------------------------------------

Nice
Attachment #8777928 - Flags: review?(adw) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5a915c1da4eb
reduce reference-counting in Places; r=adw
https://hg.mozilla.org/mozilla-central/rev/5a915c1da4eb
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.