Closed Bug 1337427 Opened 7 years ago Closed 7 years ago

Implement GCVector::sweep

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: sfink, Assigned: sfink)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

GCVector cannot currently be used within WeakCache<> because it doesn't implement sweep().
I implemented this because I mistakenly thought I could use it for bug 1337209 (registering a list of objects to read mark bits from in a way that would not mark them or keep them alive), but then realized I couldn't use it because it compacted the indexes. But still, it seems worth filling out the functionality, so that all of our GCFoo containers can both trace and sweep.
Attachment #8834459 - Flags: review?(jcoppeard)
Comment on attachment 8834459 [details] [diff] [review]
Implement GCVector::sweep

Review of attachment 8834459 [details] [diff] [review]:
-----------------------------------------------------------------

Great, looks nice.

::: js/src/jsapi-tests/testGCWeakCache.cpp
@@ +111,5 @@
> +
> +    cache.append(tenured1);
> +    cache.append(tenured2);
> +    cache.append(nursery1);
> +    cache.append(nursery2);

Need to check return values here.

Actually, these methods could all be MOZ_MUST_USE.
Attachment #8834459 - Flags: review?(jcoppeard) → review+
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9bccecac02bb
Implement GCVector::sweep, r=jonco
https://hg.mozilla.org/integration/mozilla-inbound/rev/237552f782e7
Add MOZ_MUST_USE to GCVector bool returns, r=woof!
https://hg.mozilla.org/mozilla-central/rev/9bccecac02bb
https://hg.mozilla.org/mozilla-central/rev/237552f782e7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.