diff options
Diffstat (limited to 'deps/v8/src/zone/zone.cc')
-rw-r--r-- | deps/v8/src/zone/zone.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/deps/v8/src/zone/zone.cc b/deps/v8/src/zone/zone.cc index 8dd96dc1cd..d2dd9ce068 100644 --- a/deps/v8/src/zone/zone.cc +++ b/deps/v8/src/zone/zone.cc @@ -49,7 +49,8 @@ Zone::Zone(AccountingAllocator* allocator, const char* name) limit_(0), allocator_(allocator), segment_head_(nullptr), - name_(name) { + name_(name), + sealed_(false) { allocator_->ZoneCreation(this); } @@ -62,6 +63,8 @@ Zone::~Zone() { } void* Zone::New(size_t size) { + CHECK(!sealed_); + // Round up the requested size to fit the alignment. size = RoundUp(size, kAlignmentInBytes); @@ -111,9 +114,9 @@ void Zone::DeleteAll() { // of the segment chain. Returns the new segment. Segment* Zone::NewSegment(size_t requested_size) { Segment* result = allocator_->GetSegment(requested_size); - DCHECK_GE(result->size(), requested_size); - segment_bytes_allocated_ += result->size(); if (result != nullptr) { + DCHECK_GE(result->size(), requested_size); + segment_bytes_allocated_ += result->size(); result->set_zone(this); result->set_next(segment_head_); segment_head_ = result; |