Closed Bug 1233862 Opened 9 years ago Closed 9 years ago

Implement a WeakCache wrapper type to cause a thing to be swept automatically every GC

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox46 --- affected
firefox48 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch impl_WeakCache-v0.diff (obsolete) (deleted) — Splinter Review
This is like WeakRef, but for things that are part of the runtime environment rather than discovered via tracing.
Attachment #8700200 - Flags: review?(sphink)
Comment on attachment 8700200 [details] [diff] [review] impl_WeakCache-v0.diff Review of attachment 8700200 [details] [diff] [review]: ----------------------------------------------------------------- Sorry, this slipped through the cracks. ::: js/src/jsapi-tests/testGCWeakCache.cpp @@ +39,5 @@ > + CHECK(cache.has(tenured2)); > + CHECK(cache.has(nursery1)); > + CHECK(cache.has(nursery2)); > + > + // Since this relies on the UID map, we cannot check the non-existance *nonexistence @@ +40,5 @@ > + CHECK(cache.has(nursery1)); > + CHECK(cache.has(nursery2)); > + > + // Since this relies on the UID map, we cannot check the non-existance > + // of a pointer in the map -- see below for that. You don't want to do it via CHECK(cache.count() == 2)?
Attachment #8700200 - Flags: review?(sphink) → review+
Depends on: 1248094
Attached patch impl_WeakCache-v1.diff (deleted) — Splinter Review
Rebased to use the new Policy stuff. Quite a bit cleaner now. Certainly cleaner to use. I'm going to carry the r+.
Attachment #8700200 - Attachment is obsolete: true
Attachment #8740182 - Flags: review+
Blocks: 1263769
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: