Index: src/heap.h |
diff --git a/src/heap.h b/src/heap.h |
index 7a1bed3560289912a1e7c22b2ad994348cbdffa5..633bc03531ac5c2c582a7ad2c3e263226686b780 100644 |
--- a/src/heap.h |
+++ b/src/heap.h |
@@ -1938,15 +1938,16 @@ class DescriptorLookupCache { |
class DisallowAllocationFailure { |
public: |
- DisallowAllocationFailure() { |
- old_state_ = HEAP->disallow_allocation_failure_; |
- HEAP->disallow_allocation_failure_ = true; |
+ explicit DisallowAllocationFailure(Heap* heap) : heap_(heap) { |
Vitaly Repeshko
2011/04/15 00:29:39
Please don't waste time optimizing debug-only faci
|
+ old_state_ = heap_->disallow_allocation_failure_; |
+ heap_->disallow_allocation_failure_ = true; |
} |
~DisallowAllocationFailure() { |
- HEAP->disallow_allocation_failure_ = old_state_; |
+ heap_->disallow_allocation_failure_ = old_state_; |
} |
private: |
bool old_state_; |
+ Heap* heap_; |
}; |
class AssertNoAllocation { |