// -----------------------------------------------------------------------------------------------------
// Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
// Copyright (c) 2016-2019, Knut Reinert & MPI für molekulare Genetik
// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
// -----------------------------------------------------------------------------------------------------

/*!\file
 * \brief Provides C++17/20 additions to the \<new\> header, if they are not already available.
 * \author Rene Rahn <rene.rahn AT fu-berlin.de>
 */

#pragma once

#include <new>

#ifndef __cpp_lib_hardware_interference_size

/*!\defgroup new new
 * \ingroup std
 * \brief The \<new\> header from C++17's standard library.
 */

namespace std
{

//!\addtogroup new
//!\{

/*!\brief Minimum offset between two objects to avoid false sharing.
 * \sa https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size
 */
inline constexpr std::size_t hardware_destructive_interference_size = 64;

/*!\brief Maximum size of contiguous memory to promote true sharing.
 * \sa https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size
 */
inline constexpr std::size_t hardware_constructive_interference_size = 64;

//!\}
} // namespace std

#endif // __cpp_lib_hardware_interference_size
