Closed
Bug 609185
Opened 16 years ago
Closed 16 years ago
Should it be GCList<Foo*> or GCList<Foo>?
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: stejohns, Assigned: stejohns)
Details
Attachments
(1 file)
|
58.42 KB,
patch
|
lhansen
:
review+
treilly
:
feedback+
|
Details | Diff | Splinter Review |
The old List<> classes required an explicit pointer type, so the new GCList/RCList classes followed suit. However, the SafeGC work will be using GCRef<> in a form that forbids the *, meaning that GCList and GCRef will have weirdly differing declaration semantics. Perhaps we should change GCList/RCList to follow GCRef now, before too much conversion in Flash/AIR makes changes difficult? Opinions welcomed.
| Assignee | ||
Comment 1•16 years ago
|
||
...and also WeakRefList.
| Assignee | ||
Comment 2•16 years ago
|
||
Patch that converts GCList, RCList, WeakRefList. Do we prefer this style or the status quo? I don't care much, but consistency is useful, so whatever GCRef/GCMember is gonna do, these should too...
Assignee: nobody → stejohns
Attachment #487787 -
Flags: review?(lhansen)
Attachment #487787 -
Flags: feedback?(bgetlin)
| Assignee | ||
Updated•16 years ago
|
Attachment #487787 -
Flags: feedback?(treilly)
Comment 3•16 years ago
|
||
After doing it both ways you definitely want GCList<Foo>. It gives your template more power, there's not much you can do when T= Foo* but when T=Foo you can use T in more interesting ways. For safegc we're moving from WriteBarrier<Foo*> to GCMember<Foo> and code won't compile if Foo doesn't derive from a GC class.
| Assignee | ||
Comment 4•16 years ago
|
||
OK then... now I just need an R+ :-)
Updated•16 years ago
|
Attachment #487787 -
Flags: feedback?(treilly) → feedback+
Comment 5•16 years ago
|
||
(In reply to comment #3)
> After doing it both ways you definitely want GCList<Foo>. It gives your
> template more power, there's not much you can do when T= Foo* but when T=Foo
> you can use T in more interesting ways. For safegc we're moving from
> WriteBarrier<Foo*> to GCMember<Foo> and code won't compile if Foo doesn't
> derive from a GC class.
+1
Comment 6•16 years ago
|
||
Comment on attachment 487787 [details] [diff] [review]
Patch
I like it and I can't think of any downsides except that of course, the other List types require the use of '*' when that's what you mean, so there's some space for error if one is converted to the other (not terribly likely).
One additional reason to like it is that it closes the gap between how we'd see such a list in AS3 (namely, List<Fnord>) and in C++ (namely, GCList<Fnord>) - assuming AS3 had generic types :-)
Attachment #487787 -
Flags: review?(lhansen) → review+
Comment 7•16 years ago
|
||
I worried for a minute about losing the ability to deal with plain values, e.g.
struct Point { float x,y; };
GCList<Point>
But thats nonsense right? (Points are not gc objects). And, plain List<> should still support non-pointer types. List<Point> and List<Point*> hopefully are both valid.
I don't have a strong opinion about naming, but I'll say this anyway at the risk of being blacklisted. Since * would be implied, and the elements of the lists behave like individual GCRef<T>, should we call it GCRefList<T>? (ditto RCRefList).
| Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> But thats nonsense right? (Points are not gc objects). And, plain List<>
> should still support non-pointer types.
List<> is no more, but DataList<Point> should work.
> List<Point> and List<Point*> hopefully are both valid.
DataList<Point*> explicitly will *not* work, you must use UnmanagedPointerList<Point*>. You might ask why this is, when the underlying representation is the same? Answer is that existing List<> usage in Flash/AIR code exhibited a lot of copy/paste errors with various pointer types; I felt that making the distinction between managed lists (GCList/RCList/WeakRefList) and unmanaged BE CAREFUL CRASHY DANGER LIES here lists (UnmanagedPointerList) was worth making painfully explicit.
> lists behave like individual GCRef<T>, should we call it GCRefList<T>? (ditto
> RCRefList).
Once that lands, I'd be happy to entertain that change.
| Assignee | ||
Comment 9•16 years ago
|
||
TR 5493:0082f4b772d1
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Attachment #487787 -
Flags: feedback?(bgetlin)
You need to log in
before you can comment on or make changes to this bug.
Description
•