Closed
Bug 961077
Opened 10 years ago
Closed 10 years ago
PersistentRooted should not publicly derive from LinkedListElement
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(2 files, 1 obsolete file)
6.82 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
5.61 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
This allows clients to the API to put these into their own linked lists - something that can only have unfortunate consequences.
Assignee | ||
Comment 1•10 years ago
|
||
Here's a patch to make this use private inheritance. We need to make LinkedList<T> and LinkedListElement<T> friend classes so they can cast the base pointer down to a PersistentRooted pointer again. I removed the existing typedefs for these types because they're never used.
Attachment #8361793 -
Flags: review?(sphink)
Comment 2•10 years ago
|
||
Comment on attachment 8361793 [details] [diff] [review] persistent-rooted-inheritance Review of attachment 8361793 [details] [diff] [review]: ----------------------------------------------------------------- The one thing that bothers me about this is the call through a 'marker' function pointer instead of templatizing on the function. Can the optimizer eliminate that? If not, something like the attached patch on top of your patch would eliminate a level of indirection.
Attachment #8361793 -
Flags: review?(sphink) → review+
Comment 3•10 years ago
|
||
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Steve Fink [:sfink] from comment #2) > The one thing that bothers me about this is the call through a 'marker' > function pointer instead of templatizing on the function. Can the optimizer > eliminate that? If not, something like the attached patch on top of your > patch would eliminate a level of indirection. I agree, and I'm not sure of the answer. I'm going to land the original patch and look into this further.
Whiteboard: [leave open]
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0fcf310b266
Assignee | ||
Comment 6•10 years ago
|
||
How about this? It's a version of your patch with typedefs to make it easier to read.
Attachment #8363171 -
Attachment is obsolete: true
Attachment #8363647 -
Flags: review?(sphink)
Comment 7•10 years ago
|
||
Comment on attachment 8363647 [details] [diff] [review] tidy-perisitent-rooted Review of attachment 8363647 [details] [diff] [review]: ----------------------------------------------------------------- Oh! It's clever how you merged the two mark functions into a single signature. Now you just need to eliminate markChainIfNotNull by partially specializing markChain on pointer types to do the null check... never mind, this is good! :)
Attachment #8363647 -
Flags: review?(sphink) → review+
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b0fcf310b266
Assignee | ||
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/00b51ce701ff
Whiteboard: [leave open]
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/00b51ce701ff
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•