Closed Bug 427030 Opened 18 years ago Closed 17 years ago

Actionmonkey MMgc: recursive postmark hook or A => B API

Categories

(Tamarin Graveyard :: Garbage Collection (mmGC), defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WONTFIX

People

(Reporter: benjamin, Assigned: jorendorff)

Details

Attachments

(1 file)

In several (many?) places in XPCOMGC I have situations where the aliveness of an object A (XPCNativeMap) implies that one or more other objects B must stay alive. Object B, however, is not reachable directly from object A: it is maintained in an out-of-band map of some sort. The canonical example of this is xpconnect JS wrappers around XPCOM objects: * the wrapper should stay alive as long as the XPCOM object * there may be multiple wrappers per XPCOM object * most XPCOM objects don't have wrappers, so we don't want to spend a word per-object But the specific case I'm dealing with right now is ClassInfo2NativeSetMap in xpcmaps.h.
Attached patch v1Splinter Review
Here is a very basic (potentially very very slow) implementation of an A=>B API in MMgc. The public APIs are MMgc::GC::{Link,Unlink}(void *source, void *target). A link from A to B makes the GC act as though A actually contains a pointer to B. The patch includes tests illustrating this. API rule: Don't gc->Free(x) if any links to x might exist. (Whether this restriction makes any sense is debatable. For now it is convenient.) Known issues: This causes GC.h to #include <map> and <utility>, which makes the SpiderMonkey build slow. It also needs comments on GC::Lock and GC::Unlock.
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
In the last sentence of comment 1, I meant "GC::Link and GC::Unlink".
Mass-WONTFIXing ActionMonkey bugs.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: