nsDeque should handle out-of-memory better

RESOLVED FIXED in mozilla1.9.3a1

Status

()

Core
XPCOM
P2
normal
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla1.9.3a1
Points:
---

Firefox Tracking Flags

(status1.9.2 beta1-fixed, status1.9.1 .6-fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
Created attachment 404717 [details] [diff] [review]
patch

peterv and I noticed this while debugging cycle collector crashes; given that the cycle collector creates nsDeque objects that require multi-megabyte allocations, this could actually affect users sometimes.

(The cycle collector, at least, handles silent failure to add to a deque just fine, in that the worst side effect would be failure to collect objects.)

I also made it use memcpy rather than copying the pointers in an array.
Attachment #404717 - Flags: review?(benjamin)

Updated

8 years ago
Attachment #404717 - Flags: review?(benjamin) → review+
(Assignee)

Comment 1

8 years ago
http://hg.mozilla.org/mozilla-central/rev/95fb146a7337
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
(Assignee)

Comment 2

8 years ago
Comment on attachment 404717 [details] [diff] [review]
patch

Want to get this in on the chance that it's responsible for some of the cycle collector crashes.
Attachment #404717 - Flags: approval1.9.2?

Updated

8 years ago
Attachment #404717 - Flags: approval1.9.2? → approval1.9.2+
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/d2a814272746
status1.9.2: --- → beta1-fixed
(Assignee)

Updated

8 years ago
Attachment #404717 - Flags: approval1.9.1.5?
Comment on attachment 404717 [details] [diff] [review]
patch

>  * @return  capacity of the deque
>  *          If the deque did not grow,
>  *          and you knew its capacity beforehand,
>  *          then this would be a way to indicate the failure.
>  */
>-PRInt32 nsDeque::GrowCapacity() {
>+PRBool nsDeque::GrowCapacity() {

Could you fix up the comment to match the new return value? Thanks

Approved for 1.9.1.5, a=dveditz for release-drivers
Attachment #404717 - Flags: approval1.9.1.5? → approval1.9.1.5+
(Assignee)

Comment 5

8 years ago
Comment fix landed:
http://hg.mozilla.org/mozilla-central/rev/5edfb6dce6e9
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/642185ee31d3
(Assignee)

Comment 6

8 years ago
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/b3078ea11041
(with comment fix rolled in)
status1.9.1: --- → .5-fixed
You need to log in before you can comment on or make changes to this bug.