Closed Bug 906909 Opened 6 years ago Closed 6 years ago

mozilla::LinkedList::debugAssertIsSane doesn't compile

Categories

(Core :: MFBT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: justin.lebar+bug, Assigned: justin.lebar+bug)

Details

Attachments

(1 file)

mozilla::LinkedList::debugAssertIsSane() has many compile errors.  Oops.

Patch in a moment.
Attached patch Patch, v1Splinter Review
Attachment #792465 - Flags: review?(jwalden+bmo)
Assignee: nobody → justin.lebar+bug
Comment on attachment 792465 [details] [diff] [review]
Patch, v1

Review of attachment 792465 [details] [diff] [review]:
-----------------------------------------------------------------

Hmm.  If this has to be called to be useful, it's probably not useful.  Could we do any of this checking at list-mutation time, to avoid the need to explicitly call this, somehow?  I dunno, this is obviously fine enough, but it's not a very satisfying solution.
Attachment #792465 - Flags: review?(jwalden+bmo) → review+
We could definitely call it sometimes.  I'm just a little wary of making debug builds slow for no reason.

I suppose we could call it whenever we do an O(n) operation.  Which is just Clear().  I guess that's not very good...  :)
I checked this in since it's an obvious step in the right direction.

I'm definitely not against running debugAssertIsSane at choice points during execution; the question is just: when?  Maybe it's a premature optimization not to do it every time we mutate the list.  Anyway, we can discuss elsewhere (or not; it's still useful for debugging to have this call).
https://hg.mozilla.org/mozilla-central/rev/35c8fa3d4fe7
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.