Closed
Bug 834769
Opened 11 years ago
Closed 11 years ago
Change the "destroyed" state value for RefCounted
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(1 file, 1 obsolete file)
1.86 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
The current value is -0xdead, and when looking in a debugger, it can be confusing, because as a negative value, it will should up as -57005, and as hexadecimal, as 0xffff2153. This got me confused for a few in bug 834459 because i have had conflated values of ref count in the past because of a bug in the custom linker. If it had showed up as 0xffffdead, that would have been more obvious.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #706454 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → mh+mozilla
Comment 2•11 years ago
|
||
Comment on attachment 706454 [details] [diff] [review] Change the "destroyed" state value for RefCounted Review of attachment 706454 [details] [diff] [review]: ----------------------------------------------------------------- ::: mfbt/RefPtr.h @@ +46,5 @@ > friend class RefPtr<T>; > > public: > RefCounted() : refCnt(0) { } > + ~RefCounted() { MOZ_ASSERT(refCnt == 0xffffdead); } btw, you should probably make RefCounted's ctor and dtor protected. It doesn't make sense for someone to directly allocate or delete a RefCounted. Plus, RefCounted's dtor is not virtual, so derived classes' dtors would not be called (though a debug build would hit this assert).
Comment 3•11 years ago
|
||
Comment on attachment 706454 [details] [diff] [review] Change the "destroyed" state value for RefCounted Review of attachment 706454 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Good call on protecting the ctor/dtor, indeed.
Attachment #706454 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/bc2bbe9836c7 (with ctor/dtor made protected)
Assignee | ||
Comment 5•11 years ago
|
||
Backed out. -Werror is making the tree red because of 0xffffdead being unsigned. https://hg.mozilla.org/integration/mozilla-inbound/rev/954fc89373b8
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #707571 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•11 years ago
|
Attachment #706454 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #707571 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/799de1cf584b
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/799de1cf584b
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•