Closed Bug 624838 Opened 15 years ago Closed 15 years ago

We need an "Unsafe" GCObject list

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WONTFIX

People

(Reporter: stejohns, Assigned: stejohns)

Details

Attachments

(1 file)

There are a few degenerate cases in Flash/AIR that seem to need an unsafe list of GCObjects: that is, a list that deliberately does not prevent the object from being collected, but without using WeakRef. Rather than force them to invent their own, let's provide our own minimal tool for this, so we may be able to at least add debug sniffing for problems.
Attached patch PatchSplinter Review
Holding my nose at the necessity of this, but oh well...
Assignee: nobody → stejohns
Attachment #502920 - Flags: superreview?(lhansen)
Attachment #502920 - Flags: review?(treilly)
How does this fit in with the notion of 'handles' that Tommy is working on (bug 623284)?
Comment on attachment 502920 [details] [diff] [review] Patch In general I'm utterly opposed to this, and the correct fix would seem to be to make weakrefs cheaper. If weakrefs are too expensive then let's figure out why, and whether something can be done about it. Just because a hack works does not mean it's a good idea, or (shudder) that it should be codified.
Attachment #502920 - Flags: superreview?(lhansen) → superreview-
After offline discussion, withdrawing this bug -- there is a short-term need for something like this in Flash, but we don't want to enshrine it in Tamarin, so we'll put the relevant code directly into Flash.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Attachment #502920 - Flags: review?(treilly)
If this list data structure has to exist it it should exist in the vm and not be hidden away in the player where we'll forget about it and probably have to eradicate it painfully later. We should own all memory management data structures. The natural solution for this is to have a linked list of all objects of a class embedded in the class itself but we can't do that because our scanner will traverse that list and none of these things will be collected. I wouldn't call this a degenerate case, putting all the instances of "foo" in a list that I can iterate in order later seems pretty normal to me. Besides making weak refs cheaper the other solution here is to employ exact tracing of these objects, use a linked list and have the exact tracer ignore the linked list fields. For information purposes the linked list with GCHiddenPointer fields solution was rejected because we want GCHiddenPointer to die.
I really, really do not want to own this API. If the functionality must exist in MMgc then it needs to be supported through something meaningful, like weak refs, not an ad-hoc solution that is (im)morally equivalent to GCHiddenPointer. (Generally, I have no ambition for MMgc to "own" all the memory management.)
We could just have the player use the WeakList abstraction and since we own it we can optimize it if we need to, the list could be clever and use unscanned memory for the storage and hook into presweep to clean it up.
FWIW, I don't think using "real" WeakRefs was ever fully explored; it was asserted by the original author (without proof, afaik) that using WeakRefs would be "too slow".
bulk verifying resolved !fixed issues
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: