Closed
Bug 1120271
Opened 10 years ago
Closed 10 years ago
Add compacting support to SourceBuffer
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: seth, Assigned: seth)
References
Details
Attachments
(1 file, 1 obsolete file)
10.19 KB,
patch
|
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
SourceBuffer uses memory efficiently when images have a Content-Length header, but when it doesn't know the size in advance it generally ends up allocating more memory than it needs because it grows its buffer exponentially. When an image has finished loading and all decoders have finished, we should compact the SourceBuffer so it uses only the memory it needs.
Assignee | ||
Comment 1•10 years ago
|
||
Timothy, don't feel like you need to review this today. It's ready now so I'm going ahead and uploading it, though. This patch adds compacting support for SourceBuffer. It's pretty straightforward: we count the number of active consumers, and every time we *both* have zero active consumers and the SourceBuffer is marked complete, we attempt to compact. Compacting just means allocating a single new chunk that can hold all of the data, and then copying all of the old chunks into it. We do this with the lock held so that we don't have to worry about any new consumers coming along and grabbing pointers to the data.
Attachment #8547282 -
Flags: review?(tnikkel)
Updated•10 years ago
|
Attachment #8547282 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 2•10 years ago
|
||
Thanks for the review, Timothy! This needed a minor rebase.
Assignee | ||
Updated•10 years ago
|
Attachment #8547282 -
Attachment is obsolete: true
Assignee | ||
Comment 3•10 years ago
|
||
Here's a try job: https://tbpl.mozilla.org/?tree=Try&rev=9047b70e2ea0
Assignee | ||
Comment 4•10 years ago
|
||
There are failures in that try job, but they're unexpected passes from bug 985193, which was mistakenly included in that try push. I went ahead and pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/3c89bb35ffd7
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3c89bb35ffd7
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8549890 [details] [diff] [review] Add compacting support for SourceBuffer Approval Request Comment [Feature/regressing bug #]: Part of fix for bug 1125272 and bug 1119938. [User impact if declined]: Already approved. [Describe test coverage new/current, TreeHerder]: In 38 for a long time. [Risks and why]: Low risk; in 38 for a long time. [String/UUID change made/needed]: None.
Attachment #8549890 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 7•10 years ago
|
||
Pushed to Aurora: https://hg.mozilla.org/releases/mozilla-aurora/rev/e2a6fcce0410
Updated•10 years ago
|
status-firefox37:
--- → fixed
status-firefox38:
--- → fixed
Comment 8•10 years ago
|
||
Comment on attachment 8549890 [details] [diff] [review] Add compacting support for SourceBuffer Aurora approval previously granted for a collection of ImageLib related bugs that Seth worked on and QE verified before uplift.
Attachment #8549890 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in
before you can comment on or make changes to this bug.
Description
•