Closed Bug 1204594 Opened 9 years ago Closed 9 years ago

Make use of MOZ_RAII and ScopeExit to simplify some Auto guards in the GC

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: terrence, Assigned: terrence)

Details

Attachments

(1 file)

8 files changed, 33 insertions(+), 80 deletions(-)
Attachment #8660853 - Flags: review?(sphink)
Comment on attachment 8660853 [details] [diff] [review]
use_MOZ_RAII-v0.diff

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

\o/ I hated that ugly thing.

We don't need to include anything to get the definition, though?

::: js/src/gc/Marking.cpp
@@ -1249,5 @@
>  {
>  #ifdef DEBUG
> -    struct AutoCheckCompartment {
> -        bool& flag;
> -        explicit AutoCheckCompartment(bool& comparmentCheckFlag) : flag(comparmentCheckFlag) {

-1 typo here too
Attachment #8660853 - Flags: review?(sphink) → review+
(In reply to Steve Fink [:sfink, :s:] from comment #2)
> Comment on attachment 8660853 [details] [diff] [review]
> use_MOZ_RAII-v0.diff
> 
> Review of attachment 8660853 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> \o/ I hated that ugly thing.
> 
> We don't need to include anything to get the definition, though?

As in, shouldn't this patch have some #include <mfbt/Attributes.h> lines?
Er... that would be mozilla/Attributes.h, I think.
(In reply to Steve Fink [:sfink, :s:] from comment #4)
> Er... that would be mozilla/Attributes.h, I think.

Apparently not? I think that js/HeapAPI.h has it, which means we get it "for free" everywhere. We /should/ stop smuggling it, but that's a bit of a fool's errand at this point.
https://hg.mozilla.org/mozilla-central/rev/60fdd3ce9836
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: