/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/heap/cppgc/object-poisoner.h
38 строк
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_HEAP_CPPGC_OBJECT_POISONER_H_ #define V8_HEAP_CPPGC_OBJECT_POISONER_H_ #include "src/base/sanitizer/asan.h" #include "src/heap/cppgc/heap-object-header.h" #include "src/heap/cppgc/heap-page.h" #include "src/heap/cppgc/heap-visitor.h" #include "src/heap/cppgc/object-view.h" namespace cppgc { namespace internal { #ifdef V8_USE_ADDRESS_SANITIZER // Poisons the payload of unmarked objects. class UnmarkedObjectsPoisoner : public HeapVisitor<UnmarkedObjectsPoisoner> { friend class HeapVisitor<UnmarkedObjectsPoisoner>; private: bool VisitHeapObjectHeader(HeapObjectHeader& header) { if (header.IsFree() || header.IsMarked()) return true; ASAN_POISON_MEMORY_REGION(header.ObjectStart(), ObjectView<>(header).Size()); return true; } }; #endif // V8_USE_ADDRESS_SANITIZER } // namespace internal } // namespace cppgc #endif // V8_HEAP_CPPGC_OBJECT_POISONER_H_