28 #ifndef V8_ZONE_INL_H_
29 #define V8_ZONE_INL_H_
43 ASSERT(scope_nesting_ > 0);
45 size =
RoundUp(size, kAlignment);
50 position_ += ((~size) & 4) & (
reinterpret_cast<intptr_t
>(position_) & 4);
58 if (size > limit_ - position_) {
59 result = NewExpand(size);
67 return reinterpret_cast<void*
>(result);
73 return static_cast<T*
>(
New(length *
sizeof(
T)));
78 return segment_bytes_allocated_ > zone_excess_limit_;
83 segment_bytes_allocated_ += delta;
84 isolate_->
counters()->zone_segment_bytes()->Set(segment_bytes_allocated_);
88 template <
typename Config>
97 void* ZoneObject::operator
new(
size_t size,
Zone* zone) {
98 return zone->New(static_cast<int>(size));
101 inline void* ZoneAllocationPolicy::New(
size_t size) {
103 return zone_->
New(static_cast<int>(size));
107 template <
typename T>
108 void* ZoneList<T>::operator
new(
size_t size, Zone* zone) {
109 return zone->New(static_cast<int>(size));
114 : zone_(zone), mode_(mode) {
115 zone_->scope_nesting_++;
119 bool ZoneScope::ShouldDeleteOnExit() {
126 #endif // V8_ZONE_INL_H_
bool IsAddressAligned(Address addr, intptr_t alignment, int offset=0)
#define ASSERT(condition)
static unsigned allocation_size_
T RoundUp(T x, intptr_t m)
void adjust_segment_bytes_allocated(int delta)
#define T(name, string, precedence)