Index: test/cctest/test-spaces.cc |
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc |
index d8a4b02b330b44b0c2ed0c7f95b937ad34bec41a..4a658235193dbc7de64c36b9030c0e03bc97daed 100644 |
--- a/test/cctest/test-spaces.cc |
+++ b/test/cctest/test-spaces.cc |
@@ -872,14 +872,15 @@ UNINITIALIZED_TEST(InlineAllocationObserver) { |
CHECK_EQ(observer1.count(), 20); // no more notifications. |
CHECK_EQ(observer2.count(), 3); // this one is still active. |
- // Ensure that Pause/ResumeInlineAllocationObservers work correctly. |
+ // Ensure that PauseInlineAllocationObserversScope work correctly. |
AllocateUnaligned(new_space, 48); |
CHECK_EQ(observer2.count(), 3); |
- new_space->PauseInlineAllocationObservers(); |
- CHECK_EQ(observer2.count(), 3); |
- AllocateUnaligned(new_space, 384); |
- CHECK_EQ(observer2.count(), 3); |
- new_space->ResumeInlineAllocationObservers(); |
+ { |
+ PauseInlineAllocationObserversScope pause_observers(new_space); |
+ CHECK_EQ(observer2.count(), 3); |
+ AllocateUnaligned(new_space, 384); |
+ CHECK_EQ(observer2.count(), 3); |
+ } |
CHECK_EQ(observer2.count(), 3); |
// Coupled with the 48 bytes allocated before the pause, another 48 bytes |
// allocated here should trigger a notification. |