Files
snmalloc/src/pal/pal_plain.h
Nathaniel Filardo bf3c99d87f fully-static PALs
2020-09-09 12:55:48 +01:00

32 lines
676 B
C++

#pragma once
#include "../ds/bits.h"
namespace snmalloc
{
// Can be extended
// Will require a reserve method in subclasses.
template<class State>
class PALPlainMixin : public State
{
public:
// Notify platform that we will not be using these pages
static void notify_not_using(void*, size_t) noexcept {}
// Notify platform that we will not be using these pages
template<ZeroMem zero_mem>
static void notify_using(void* p, size_t size) noexcept
{
if constexpr (zero_mem == YesZero)
{
State::zero(p, size);
}
else
{
UNUSED(p);
UNUSED(size);
}
}
};
} // namespace snmalloc