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)
57#if defined(CPPGC_2GB_CAGE)
58constexpr size_t kCagedHeapDefaultReservationSize =
59 static_cast<size_t>(2) *
kGB;
60constexpr size_t kCagedHeapMaxReservationSize =
61 kCagedHeapDefaultReservationSize;
63constexpr size_t kCagedHeapDefaultReservationSize =
64 static_cast<size_t>(4) *
kGB;
65#if defined(CPPGC_POINTER_COMPRESSION)
66constexpr size_t kCagedHeapMaxReservationSize =
67 size_t{1} << (31 + kPointerCompressionShift);
69constexpr size_t kCagedHeapMaxReservationSize =
70 kCagedHeapDefaultReservationSize;
73constexpr size_t kCagedHeapReservationAlignment = kCagedHeapMaxReservationSize;
76static constexpr size_t kDefaultAlignment =
sizeof(
void*);
79static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
constexpr size_t kAllocationGranularity
Definition: api-constants.h:82
constexpr size_t kKB
Definition: api-constants.h:21
constexpr size_t kCachelineSize
Definition: api-constants.h:85
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