Make imageCacheQueue use nsTArray

RESOLVED FIXED in Firefox 57

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bkelly, Assigned: bkelly)

Tracking

53 Branch
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.