de20e6d3a8
Unfortunately the previous strategy was slower but more memory efficient. For now simply revert. Revert "[zone] Use 32kb instead of 1MB as high zone page size" Revert "[zone] Get rid of the Zone's segment pool" Revert "[zone] Further simplify zone expansion, use single default page size" Bug: chromium:908359 Change-Id: I649542e7e61eef0c14a26ffd21039e8340ab4d04 Reviewed-on: https://chromium-review.googlesource.com/c/1351027 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#57872}
33 lines
871 B
C++
33 lines
871 B
C++
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/zone/accounting-allocator.h"
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
TEST(Zone, SegmentPoolConstraints) {
|
|
size_t sizes[]{
|
|
0, // Corner case
|
|
AccountingAllocator::kMaxPoolSize,
|
|
GB // Something really large
|
|
};
|
|
|
|
AccountingAllocator allocator;
|
|
for (size_t size : sizes) {
|
|
allocator.ConfigureSegmentPool(size);
|
|
size_t total_size = 0;
|
|
for (size_t power = 0; power < AccountingAllocator::kNumberBuckets;
|
|
++power) {
|
|
total_size +=
|
|
allocator.unused_segments_max_sizes_[power] * (size_t(1) << power);
|
|
}
|
|
EXPECT_LE(total_size, size);
|
|
}
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|