5#ifndef INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_
6#define INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_
19namespace api_constants {
21constexpr size_t kKB = 1024;
28static constexpr size_t kFullyConstructedBitFieldOffsetFromPayload =
31static constexpr uint16_t kFullyConstructedBitMask = uint16_t{1};
33static constexpr size_t kPageSizeBits = 17;
34static constexpr size_t kPageSize =
size_t{1} << kPageSizeBits;
36#if defined(V8_HOST_ARCH_ARM64) && defined(V8_OS_DARWIN)
38#elif defined(V8_HOST_ARCH_PPC64)
40#elif defined(V8_HOST_ARCH_LOONG64) || defined(V8_HOST_ARCH_MIPS64)
46static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2;
48#if defined(CPPGC_POINTER_COMPRESSION)
49#if defined(CPPGC_ENABLE_LARGER_CAGE)
50constexpr unsigned kPointerCompressionShift = 3;
52constexpr unsigned kPointerCompressionShift = 1;
56#if defined(CPPGC_CAGED_HEAP)
57constexpr size_t kCagedHeapDefaultReservationSize =
58 static_cast<size_t>(4) *
kGB;
59#if defined(CPPGC_POINTER_COMPRESSION)
60constexpr size_t kCagedHeapMaxReservationSize =
61 size_t{1} << (31 + kPointerCompressionShift);
63constexpr size_t kCagedHeapMaxReservationSize =
64 kCagedHeapDefaultReservationSize;
66constexpr size_t kCagedHeapReservationAlignment = kCagedHeapMaxReservationSize;
69static constexpr size_t kDefaultAlignment =
sizeof(
void*);
72static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
constexpr size_t kAllocationGranularity
Definition: api-constants.h:75
constexpr size_t kKB
Definition: api-constants.h:21
constexpr size_t kCachelineSize
Definition: api-constants.h:78
constexpr size_t kGB
Definition: api-constants.h:23
constexpr size_t kGuardPageSize
Definition: api-constants.h:43
constexpr size_t kMB
Definition: api-constants.h:22
Definition: allocation.h:38