chromium/components/gwp_asan/client/lightweight_detector/poison_metadata_recorder.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_GWP_ASAN_CLIENT_LIGHTWEIGHT_DETECTOR_POISON_METADATA_RECORDER_H_
#define COMPONENTS_GWP_ASAN_CLIENT_LIGHTWEIGHT_DETECTOR_POISON_METADATA_RECORDER_H_

#include <atomic>
#include <memory>
#include <vector>

#include "base/export_template.h"
#include "base/gtest_prod_util.h"
#include "components/gwp_asan/client/export.h"
#include "components/gwp_asan/client/lightweight_detector/shared_state.h"
#include "components/gwp_asan/common/lightweight_detector_state.h"

namespace gwp_asaninternal  // namespace gwp_asan::internal

namespace gwp_asan::internal::lud {

// Responsible for both poisoning memory allocations and tracking metadata
// associated with these poisoned allocations.
class GWP_ASAN_EXPORT PoisonMetadataRecorder
    : public SharedState<PoisonMetadataRecorder> {};

extern template class EXPORT_TEMPLATE_DECLARE(GWP_ASAN_EXPORT)
    SharedStateHolder<PoisonMetadataRecorder>;

}  // namespace gwp_asan::internal::lud

#endif  // COMPONENTS_GWP_ASAN_CLIENT_LIGHTWEIGHT_DETECTOR_POISON_METADATA_RECORDER_H_