llvm/compiler-rt/lib/scudo/standalone/allocator_config_wrapper.h

//===-- allocator_config_wrapper.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef SCUDO_ALLOCATOR_CONFIG_WRAPPER_H_
#define SCUDO_ALLOCATOR_CONFIG_WRAPPER_H_

#include "condition_variable.h"
#include "internal_defs.h"
#include "secondary.h"

namespace {

template <typename T> struct removeConst {};
removeConst<const T>;

// This is only used for SFINAE when detecting if a type is defined.
template <typename T> struct voidAdaptor {};

// This is used for detecting the case that defines the flag with wrong type and
// it'll be viewed as undefined optional flag.
template <typename L, typename R> struct assertSameType {};

} // namespace

namespace scudo {

#define OPTIONAL_TEMPLATE

#define OPTIONAL_TYPE_TEMPLATE(NAME, DEFAULT, MEMBER)

template <typename AllocatorConfig> struct BaseConfig {}; // BaseConfig

template <typename AllocatorConfig> struct PrimaryConfig {}; // PrimaryConfig

template <typename AllocatorConfig> struct SecondaryConfig {};   // SecondaryConfig

#undef OPTIONAL_TEMPLATE
#undef OPTIONAL_TEMPLATE_TYPE

} // namespace scudo

#endif // SCUDO_ALLOCATOR_CONFIG_WRAPPER_H_