Closed Bug 1626884 Opened 4 years ago Closed 4 years ago

RC should be non-copyable and its operator= should be defined only in debug builds

Categories

(Core :: MFBT, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 file)

RC should be non-copyable. It already is non-copyable in the atomic variant, but not in the non-atomic variant. This ensures that RefCounted is also non-copyable.

Also, RC's operator= should be defined only in debug builds. As already described in a code comment, it's only used in debug builds (to assign the dead value), and otherwise no modifications other than incrementing & decrementing should be possible.

Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/16ee5dd004d3
Make RC non-copyable and declare operator= only in debug builds. r=froydnj

(In reply to Narcis Beleuzu [:NarcisB] from comment #3)

Backed out for bustages on ElfLoader.

Backout link: https://hg.mozilla.org/integration/autoland/rev/a5be645883482c3a5cf75515d02e7e8bc64450ba
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=296172206&repo=autoland&lineNumber=5705

Fixed the Android builds, and relanded.

Flags: needinfo?(sgiesecke)
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2e9b2b840f49
Make RC non-copyable and declare operator= only in debug builds. r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: