/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/common/high-allocation-throughput-scope.h
37 строк
1 KB
Michaël Zasso
deps: update V8 to 9.8.177.9
02 фев 2022, 19:23
Не верифицирован
02 фев 2022, 19:23
974ab40
Код
Авторство
О чём код?
// Copyright 2021 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. #ifndef V8_COMMON_HIGH_ALLOCATION_THROUGHPUT_SCOPE_H_ #define V8_COMMON_HIGH_ALLOCATION_THROUGHPUT_SCOPE_H_ #include "include/v8-platform.h" namespace v8 { namespace internal { /** * Scope that notifies embedder's observer about entering sections with high * throughput of malloc/free operations. */ class HighAllocationThroughputScope final { public: explicit HighAllocationThroughputScope(Platform* platform) : observer_(platform->GetHighAllocationThroughputObserver()) { observer_->LeaveSection(); } HighAllocationThroughputScope(const HighAllocationThroughputScope&) = delete; HighAllocationThroughputScope& operator=( const HighAllocationThroughputScope&) = delete; ~HighAllocationThroughputScope() { observer_->EnterSection(); } private: HighAllocationThroughputObserver* observer_; }; } // namespace internal } // namespace v8 #endif // V8_COMMON_HIGH_ALLOCATION_THROUGHPUT_SCOPE_H_