#ifndef SCUDO_SECONDARY_H_
#define SCUDO_SECONDARY_H_
#include "chunk.h"
#include "common.h"
#include "list.h"
#include "mem_map.h"
#include "memtag.h"
#include "mutex.h"
#include "options.h"
#include "stats.h"
#include "string_utils.h"
#include "thread_annotations.h"
#include "vector.h"
namespace scudo {
namespace LargeBlock {
struct alignas(Max<uptr>(archSupportsMemoryTagging()
? archMemoryTagGranuleSize()
: 1,
1U << SCUDO_MIN_ALIGNMENT_LOG)) Header { … };
static_assert …;
static_assert …;
constexpr uptr getHeaderSize() { … }
template <typename Config> static uptr addHeaderTag(uptr Ptr) { … }
template <typename Config> static Header *getHeader(uptr Ptr) { … }
template <typename Config> static Header *getHeader(const void *Ptr) { … }
}
static inline void unmap(MemMapT &MemMap) { … }
namespace {
struct CachedBlock { … };
}
template <typename Config> class MapAllocatorNoCache { … };
static const uptr MaxUnreleasedCachePages = …;
template <typename Config>
bool mapSecondary(const Options &Options, uptr CommitBase, uptr CommitSize,
uptr AllocPos, uptr Flags, MemMapT &MemMap) { … }
template <typename T, size_t Size> class NonZeroLengthArray { … };
NonZeroLengthArray<T, 0>;
template <typename Config, void (*unmapCallBack)(MemMapT &) = unmap>
class MapAllocatorCache { … };
template <typename Config> class MapAllocator { … };
template <typename Config>
void *
MapAllocator<Config>::tryAllocateFromCache(const Options &Options, uptr Size,
uptr Alignment, uptr *BlockEndPtr,
FillContentsMode FillContents) { … }
template <typename Config>
void *MapAllocator<Config>::allocate(const Options &Options, uptr Size,
uptr Alignment, uptr *BlockEndPtr,
FillContentsMode FillContents) { … }
template <typename Config>
void MapAllocator<Config>::deallocate(const Options &Options, void *Ptr)
EXCLUDES(Mutex) { … }
template <typename Config>
void MapAllocator<Config>::getStats(ScopedString *Str) EXCLUDES(Mutex) { … }
}
#endif