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

//===-- vector.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_VECTOR_H_
#define SCUDO_VECTOR_H_

#include "mem_map.h"

#include <string.h>

namespace scudo {

// A low-level vector based on map. It stores the contents inline up to a fixed
// capacity, or in an external memory buffer if it grows bigger than that. May
// incur a significant memory overhead for small vectors. The current
// implementation supports only POD types.
//
// NOTE: This class is not meant to be used directly, use Vector<T> instead.
template <typename T, size_t StaticNumEntries> class VectorNoCtor {};

template <typename T, size_t StaticNumEntries>
class Vector : public VectorNoCtor<T, StaticNumEntries> {};

} // namespace scudo

#endif // SCUDO_VECTOR_H_