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;
36static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2;
38#if defined(CPPGC_POINTER_COMPRESSION)
39#if defined(CPPGC_ENABLE_LARGER_CAGE)
40constexpr unsigned kPointerCompressionShift = 3;
42constexpr unsigned kPointerCompressionShift = 1;
46#if defined(CPPGC_CAGED_HEAP)
47constexpr size_t kCagedHeapDefaultReservationSize =
48 static_cast<size_t>(4) *
kGB;
49#if defined(CPPGC_POINTER_COMPRESSION)
50constexpr size_t kCagedHeapMaxReservationSize =
51 size_t{1} << (31 + kPointerCompressionShift);
53constexpr size_t kCagedHeapMaxReservationSize =
54 kCagedHeapDefaultReservationSize;
56constexpr size_t kCagedHeapReservationAlignment = kCagedHeapMaxReservationSize;
59static constexpr size_t kDefaultAlignment =
sizeof(
void*);
62static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
constexpr size_t kAllocationGranularity
Definition: api-constants.h:65
constexpr size_t kKB
Definition: api-constants.h:21
constexpr size_t kCachelineSize
Definition: api-constants.h:68
constexpr size_t kGB
Definition: api-constants.h:23
constexpr size_t kMB
Definition: api-constants.h:22
Definition: allocation.h:38