Last Comment Bug 520661 - nsDeque should handle out-of-memory better
: nsDeque should handle out-of-memory better
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: mozilla1.9.3a1
Assigned To: David Baron :dbaron: ⌚️UTC-10
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-05 16:16 PDT by David Baron :dbaron: ⌚️UTC-10
Modified: 2009-10-30 15:08 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
beta1-fixed
.6-fixed


Attachments
patch (3.49 KB, patch)
2009-10-05 16:16 PDT, David Baron :dbaron: ⌚️UTC-10
benjamin: review+
benjamin: approval1.9.2+
dveditz: approval1.9.1.6+
Details | Diff | Splinter Review

Description David Baron :dbaron: ⌚️UTC-10 2009-10-05 16:16:15 PDT
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.
Comment 1 David Baron :dbaron: ⌚️UTC-10 2009-10-07 20:43:34 PDT
http://hg.mozilla.org/mozilla-central/rev/95fb146a7337
Comment 2 David Baron :dbaron: ⌚️UTC-10 2009-10-07 20:44:36 PDT
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.
Comment 3 David Baron :dbaron: ⌚️UTC-10 2009-10-08 11:55:25 PDT
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/d2a814272746
Comment 4 Daniel Veditz [:dveditz] 2009-10-30 12:19:12 PDT
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
Comment 6 David Baron :dbaron: ⌚️UTC-10 2009-10-30 15:08:06 PDT
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/b3078ea11041
(with comment fix rolled in)

Note You need to log in before you can comment on or make changes to this bug.