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 kPageSize =
size_t{1} << 17;
35#if defined(V8_HOST_ARCH_ARM64) && defined(V8_OS_DARWIN)
41static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2;
43#if defined(CPPGC_POINTER_COMPRESSION)
44#if defined(CPPGC_ENABLE_LARGER_CAGE)
45constexpr unsigned kPointerCompressionShift = 3;
47constexpr unsigned kPointerCompressionShift = 1;
51#if defined(CPPGC_CAGED_HEAP)
52#if defined(CPPGC_2GB_CAGE)
53constexpr size_t kCagedHeapDefaultReservationSize =
54 static_cast<size_t>(2) *
kGB;
55constexpr size_t kCagedHeapMaxReservationSize =
56 kCagedHeapDefaultReservationSize;
58constexpr size_t kCagedHeapDefaultReservationSize =
59 static_cast<size_t>(4) *
kGB;
60#if defined(CPPGC_POINTER_COMPRESSION)
61constexpr size_t kCagedHeapMaxReservationSize =
62 size_t{1} << (31 + kPointerCompressionShift);
64constexpr size_t kCagedHeapMaxReservationSize =
65 kCagedHeapDefaultReservationSize;
68constexpr size_t kCagedHeapReservationAlignment = kCagedHeapMaxReservationSize;
71static constexpr size_t kDefaultAlignment =
sizeof(
void*);
74static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
constexpr size_t kAllocationGranularity
constexpr size_t kGuardPageSize
constexpr size_t kCachelineSize