Closed Bug 1396982 Opened 7 years ago Closed 7 years ago

Make imageCacheQueue use nsTArray

Categories

(Core :: Graphics: ImageLib, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

Details

Attachments

(1 file)

While looking at bug 1396870 I noticed we are still using std::vector in the image cache code.  I wrote a patch to convert it to nsTArray, use Move constructors, etc.
Depends on: 1396870
This patch converts imageCacheQueue to use nsTArray instead of std::vector.  This is preferable for a few reasons:

1. We have runtime assertions on out-of-bounds access in nsTArray.  So its safer.
2. It has a better growth algorithm instead of simple doubling.
3. It plays nicer with our memory reporters.
4. It is more consistent in handling failure conditions than different std::vector implementations.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2835e2fcba400a60d45a3b8f9cb61fa7c81b3c4a
Attachment #8904730 - Flags: review?(tnikkel)
Attachment #8904730 - Flags: review?(tnikkel) → review+
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eb36a2188f6f
Make imageCacheQueue use nsTArray instead of std::vector. r=tnikkel
https://hg.mozilla.org/mozilla-central/rev/eb36a2188f6f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: