Closed Bug 1143042 Opened 5 years ago Closed 5 years ago

Switch AllocKind iteration over to range-based for loops

Categories

(Core :: JavaScript: GC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: ehoogeveen, Assigned: ehoogeveen)

References

Details

Attachments

(1 file, 1 obsolete file)

We can do this as a simple drop-in replacement once we have EnumeratedRange (bug 1142999).
I had to add braces in a few instances to appease MSVC. I'm not sure what the exact problem is, but I think it's something like

for (auto i : foo())
    do {
        // do stuff
    } while(0);

that it doesn't like, where the do-while is part of MOZ_ASSERT().
Assignee: nobody → emanuel.hoogeveen
Rebased somewhat, including on top of 1143966. I also had to add #ifdef DEBUG around one for loop that only contained an assertion, since with a range-based for loop the assertion was the only use of the variable (unlike a regular for loop, where the header itself uses the variable)! This was causing warn-as-err opt builds to burn.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=98e3b2557b22

(I think OSX is experiencing some infra failure - other try jobs appear similarly affected)
Attachment #8577314 - Attachment is obsolete: true
Attachment #8581193 - Flags: review?(terrence)
Comment on attachment 8581193 [details] [diff] [review]
v1.1 - Switch AllocKind iteration over to range-based for loops.

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

\o/
Attachment #8581193 - Flags: review?(terrence) → review+
This needs to land along with or after bug 1142999, but it shouldn't matter in which order you apply them.
Keywords: checkin-needed
Blocks: 1146662
https://hg.mozilla.org/mozilla-central/rev/8fcdeca7e548
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Depends on: 1289987
You need to log in before you can comment on or make changes to this bug.