Commit a0e7a76a authored by mbrandy's avatar mbrandy Committed by Commit bot

Fix cctest/test-spaces/CompactionSpace

kExpectedPages should be ceil(kNumObjects / kNumObjectsPerPage)

R=mlippautz@chromium.org, hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1418143004

Cr-Commit-Position: refs/heads/master@{#31605}
parent f85c4106
...@@ -429,8 +429,10 @@ TEST(CompactionSpace) { ...@@ -429,8 +429,10 @@ TEST(CompactionSpace) {
// Cannot loop until "Available()" since we initially have 0 bytes available // Cannot loop until "Available()" since we initially have 0 bytes available
// and would thus neither grow, nor be able to allocate an object. // and would thus neither grow, nor be able to allocate an object.
const int kNumObjects = 100; const int kNumObjects = 100;
const int kExpectedPages = (kNumObjects / (compaction_space->AreaSize() / const int kNumObjectsPerPage =
Page::kMaxRegularHeapObjectSize)); compaction_space->AreaSize() / Page::kMaxRegularHeapObjectSize;
const int kExpectedPages =
(kNumObjects + kNumObjectsPerPage - 1) / kNumObjectsPerPage;
for (int i = 0; i < kNumObjects; i++) { for (int i = 0; i < kNumObjects; i++) {
compaction_space->AllocateRawUnaligned(Page::kMaxRegularHeapObjectSize) compaction_space->AllocateRawUnaligned(Page::kMaxRegularHeapObjectSize)
.ToObjectChecked(); .ToObjectChecked();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment