static void verify_scaled_initial(size_t initial_heap_size) { MarkSweepPolicy msp; msp.initialize_all(); size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size); assert(msp.initial_gen0_size() == expected, err_msg("%zu != %zu", msp.initial_gen0_size(), expected)); assert(FLAG_IS_ERGO(NewSize) && NewSize == expected, err_msg("NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize)); }
static void verify_scaled_young_initial(size_t initial_heap_size) { MarkSweepPolicy msp; msp.initialize_all(); if (InitialHeapSize > initial_heap_size) { // InitialHeapSize was adapted by msp.initialize_all, e.g. due to alignment // caused by 64K page size. initial_heap_size = InitialHeapSize; } size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size); assert(msp.initial_young_size() == expected, "%zu != %zu", msp.initial_young_size(), expected); assert(FLAG_IS_ERGO(NewSize) && NewSize == expected, "NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize); }