Closed
Bug 1364051
Opened 7 years ago
Closed 7 years ago
Barriered pointer wrappers currently get a copy constructor by default
Categories
(Core :: JavaScript: GC, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
1.62 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
These wrapper classes may need to add barriers to this operation so we don't want a compiler generated copy constructor from the superclass being used if they forget to add an their copy constructor. For example, HeapSlot currently gains a copy constructor this way. This is not a problem but it was surprising to me. This patch forces subclasses to opt-in if they want a copy constructor.
Attachment #8866743 -
Flags: review?(sphink)
Comment 1•7 years ago
|
||
Comment on attachment 8866743 [details] [diff] [review] barrier-copy-constructors Review of attachment 8866743 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/Barrier.h @@ +326,5 @@ > explicit BarrieredBase(const T& v) : value(v) {} > > + // BarrieredBase subclasses cannot be copy constructed by default. > + BarrieredBase(const BarrieredBase<T>& other) = default; > + How does this work? I was expecting to see = delete. Is this some dark magic?
Assignee | ||
Comment 2•7 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] from comment #1) This gives BarrieredBase the default copy constructor but makes it protected.
Comment 3•7 years ago
|
||
Comment on attachment 8866743 [details] [diff] [review] barrier-copy-constructors Review of attachment 8866743 [details] [diff] [review]: ----------------------------------------------------------------- Ah, ok. Thanks.
Attachment #8866743 -
Flags: review?(sphink) → review+
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a64e7f9efef2 Make WriteBarrieredBase copy constructor protected r=sfink
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a64e7f9efef2
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•