Closed
Bug 575973
Opened 15 years ago
Closed 7 years ago
GCWeakRef API should have refEqual(void *item) method
Categories
(Tamarin Graveyard :: Garbage Collection (mmGC), defect)
Tamarin Graveyard
Garbage Collection (mmGC)
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: pnkfelix, Unassigned)
References
Details
When Steven did an audit of the player's uses of GCWeakRef::get(), he found a bunch of cases where it is only used to compare for equality with another pointer.
He correctly identified those cases as candidates for using peek() instead of get(); but, really the right thing is for GCWeakRef to offer an equality-predicate directly, rather than encouraging player code to invoke peek() directly.
Just one such predicate won't cover *all* of the cases that Steven found; in particular there's a place where the player was doing ((MethodClosure*)foo->peek())->atom() != closure->peek_savedThis(). But it would cover most of them, and seems like a sensible API addition.
Comment 1•15 years ago
|
||
I gently vote for "equals" as the name of the predicate, it having a fairly obvious correspondence with the existing "isNull". Perhaps we can have a poll.
| Reporter | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> I gently vote for "equals" as the name of the predicate, it having a fairly
> obvious correspondence with the existing "isNull". Perhaps we can have a poll.
I thought I had a good argument against this, but I really don't. (I had vague worries about people interpreting an equals() method to be a predicate on two GCWeakRef's; and worse yet, a void* argument type wouldn't stop them from writing such code. But maybe this all goes back to "you can't idiot-proof against people who won't read documentation...")
Updated•15 years ago
|
Target Milestone: --- → Future
Comment 3•7 years ago
|
||
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Comment 4•7 years ago
|
||
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in
before you can comment on or make changes to this bug.
Description
•