5#ifndef V8_HEAP_ALLOCATION_STATS_H_
6#define V8_HEAP_ALLOCATION_STATS_H_
9#include <unordered_map>
31 size_.store(stats.size_);
33 allocated_on_page_ = stats.allocated_on_page_;
48 allocated_on_page_.clear();
58 return allocated_on_page_.at(page);
69 size_.fetch_add(bytes);
71 allocated_on_page_[
page] += bytes;
77 size_.fetch_sub(bytes);
79 DCHECK_GE(allocated_on_page_[page], bytes);
80 allocated_on_page_[
page] -= bytes;
AllocationStats & operator=(const AllocationStats &stats) V8_NOEXCEPT
std::atomic< size_t > size_
std::atomic< size_t > capacity_
void IncreaseCapacity(size_t bytes)
void DecreaseCapacity(size_t bytes)
void IncreaseAllocatedBytes(size_t bytes, const MemoryChunkMetadata *page)
void DecreaseAllocatedBytes(size_t bytes, const MemoryChunkMetadata *page)
size_t MaxCapacity() const
#define V8_COMPRESS_POINTERS_8GB_BOOL
constexpr intptr_t kObjectAlignment8GbHeap
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_GE(v1, v2)
constexpr bool IsAligned(T value, U alignment)