1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
10 #ifdef V8_USE_ADDRESS_SANITIZER
11 #include <sanitizer/asan_interface.h>
13 #define ASAN_UNPOISON_MEMORY_REGION(start, size) ((void) 0)
16 #include "src/counters.h"
17 #include "src/isolate.h"
18 #include "src/utils.h"
24 static const int kASanRedzoneBytes = 24; // Must be a multiple of 8.
27 bool Zone::excess_allocation() {
28 return segment_bytes_allocated_ > kExcessLimit;
32 void Zone::adjust_segment_bytes_allocated(int delta) {
33 segment_bytes_allocated_ += delta;
34 isolate_->counters()->zone_segment_bytes()->Set(segment_bytes_allocated_);
38 template <typename Config>
39 ZoneSplayTree<Config>::~ZoneSplayTree() {
40 // Reset the root to avoid unneeded iteration over all tree nodes
41 // in the destructor. For a zone-allocated tree, nodes will be
43 SplayTree<Config, ZoneAllocationPolicy>::ResetRoot();
47 void* ZoneObject::operator new(size_t size, Zone* zone) {
48 return zone->New(static_cast<int>(size));
51 inline void* ZoneAllocationPolicy::New(size_t size) {
53 return zone_->New(static_cast<int>(size));
58 void* ZoneList<T>::operator new(size_t size, Zone* zone) {
59 return zone->New(static_cast<int>(size));
64 void* ZoneSplayTree<T>::operator new(size_t size, Zone* zone) {
65 return zone->New(static_cast<int>(size));
69 } } // namespace v8::internal
71 #endif // V8_ZONE_INL_H_