Closed
Bug 1192230
Opened 9 years ago
Closed 9 years ago
clean up reference-counting in xpcom/
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(1 file)
18.03 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
Mostly, what we're doing here is eliminating: NS_ADDREF(*aOutParam = ptr); in favor of: ptr.forget(aOutParam); which is smaller and more efficient. Various null-checks might have been eliminated in passing as well.
Attachment #8644939 -
Flags: review?(erahm)
Comment 2•9 years ago
|
||
Comment on attachment 8644939 [details] [diff] [review] clean up reference-counting in xpcom/ Review of attachment 8644939 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, nice cleanup. r=me ::: xpcom/glue/nsArrayEnumerator.cpp @@ -92,5 @@ > NS_NewArrayEnumerator(nsISimpleEnumerator** aResult, nsIArray* aArray) > { > - nsSimpleArrayEnumerator* enumer = new nsSimpleArrayEnumerator(aArray); > - if (!enumer) { > - return NS_ERROR_OUT_OF_MEMORY; Presumably it's OK to get rid of this b/c the allocator our new operator uses is infallible?
Attachment #8644939 -
Flags: review?(erahm) → review+
Comment 3•9 years ago
|
||
> Presumably it's OK to get rid of this b/c the allocator our new operator
> uses is infallible?
Yes. |operator new| is infallible by default, though you can make it fallible by passing a |fallible_t| argument. See memory/mozalloc/mozalloc.h for details.
Comment 4•9 years ago
|
||
We also have some documentation on infallible allocation here: https://developer.mozilla.org/en-US/docs/Infallible_memory_allocation
Comment 6•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/69980d43dea7
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in
before you can comment on or make changes to this bug.
Description
•