c036b6cd12
This fixes two issues: - labs resetting didn't account bytes as beeing freed; - large object were not accounted. The CL introduces a single bottleneck for labs resetting in ObjectAllocator, which is aware of StatsCollector. This way NormalSpace is treated as a value object and all invariants are maintained by ObjectAllocator (and Sweeper). Bug: chromium:1056170 Change-Id: I027cc01fe5028a3dfa81905d7ea53dd12d1c1f20 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2237629 Commit-Queue: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Omer Katz <omerkatz@chromium.org> Cr-Commit-Position: refs/heads/master@{#68286}
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
// Copyright 2020 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 "test/unittests/heap/cppgc/tests.h"
|
|
|
|
#include <memory>
|
|
|
|
#include "src/heap/cppgc/object-allocator.h"
|
|
#include "test/unittests/heap/cppgc/test-platform.h"
|
|
|
|
namespace cppgc {
|
|
namespace internal {
|
|
namespace testing {
|
|
|
|
// static
|
|
std::shared_ptr<TestPlatform> TestWithPlatform::platform_;
|
|
|
|
// static
|
|
void TestWithPlatform::SetUpTestSuite() {
|
|
platform_ = std::make_unique<TestPlatform>();
|
|
cppgc::InitializeProcess(platform_->GetPageAllocator());
|
|
}
|
|
|
|
// static
|
|
void TestWithPlatform::TearDownTestSuite() {
|
|
cppgc::ShutdownProcess();
|
|
platform_.reset();
|
|
}
|
|
|
|
TestWithHeap::TestWithHeap() : heap_(Heap::Create(platform_)) {}
|
|
|
|
void TestWithHeap::ResetLinearAllocationBuffers() {
|
|
Heap::From(GetHeap())->object_allocator().ResetLinearAllocationBuffers();
|
|
}
|
|
|
|
TestSupportingAllocationOnly::TestSupportingAllocationOnly()
|
|
: no_gc_scope_(internal::Heap::From(GetHeap())) {}
|
|
|
|
} // namespace testing
|
|
} // namespace internal
|
|
} // namespace cppgc
|