Closed Bug 610022 Opened 15 years ago Closed 15 years ago

WeakRefList should have a method to prune collected items

Categories

(Tamarin Graveyard :: Virtual Machine, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stejohns, Assigned: stejohns)

Details

Attachments

(1 file, 2 obsolete files)

There are lots of ad-hoc bits of code in Flash/AIR that prunes "dead" entries from lists of WeakRefs; we should add such a method to WeakRefList directly.
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → stejohns
Attachment #488572 - Flags: review?(wsharp)
Attached patch Patch v2 (obsolete) — Splinter Review
Once again, in slightly more efficient form
Attachment #488572 - Attachment is obsolete: true
Attachment #488586 - Flags: review?(wsharp)
Attachment #488572 - Flags: review?(wsharp)
Attachment #488586 - Flags: review?(wsharp) → review+
TR 5521:bd91f230f82e
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Bah, existing code is clearly bogus; reopening (and will submit with a testcase this time, bad programmer, no cookie)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Patch v3Splinter Review
Working patch, with selftest this time
Attachment #488586 - Attachment is obsolete: true
Attachment #489307 - Flags: review?(lhansen)
Attachment #489307 - Flags: feedback?(stan)
(In reply to comment #0) > There are lots of ad-hoc bits of code in Flash/AIR that prunes "dead" entries > from lists of WeakRefs; we should add such a method to WeakRefList directly. Agree, this is a nice addition.
Comment on attachment 489307 [details] [diff] [review] Patch v3 I think "(T)NULL" would be better than "(T)0". If it were me I would not perform the ::store() unless kept < i, as that reduces write barrier traffic and generally makes it less expensive to call removeNullItems on lists that rarely see elements drop out. Depends on how you expect it to be used, I guess, and how expensive you expect a barrier to be.
Attachment #489307 - Flags: review?(lhansen) → review+
(In reply to comment #7) > I think "(T)NULL" would be better than "(T)0". Yeah, but newer gcc versions tend to be warning-prone about mismatching 0 and NULL; I thought 0 slightly less likely to generate warnings. > If it were me I would not perform the ::store() unless kept < i, Ah -- good catch. I'll test with that in mind and push that way if everything passes.
FWIW, using (T)NULL causes Xcode to generate this helpful warning: warning: NULL used in arithmetic sigh...
pushed with kept<i, TR 5557:1497bb59b69d
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Attachment #489307 - Flags: feedback?(stan)
changeset: 5558:4f999233eeac user: Steven Johnson <stejohns@adobe.com> date: Wed Nov 17 13:52:02 2010 -0800 summary: Bug 610022 (followup): I applied Lars optimization incorrectly (r=stejohns) http://hg.mozilla.org/tamarin-redux/rev/4f999233eeac
changeset: 5564:8abb0f8342eb user: Steven Johnson <stejohns@adobe.com> summary: Bug 610022 (followup 2): I *still* applied Lars optimization incorrectly (r=stejohns) http://hg.mozilla.org/tamarin-redux/rev/8abb0f8342eb
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: