Files
snmalloc/src/pal/pal.h
2019-01-18 16:17:52 +00:00

47 lines
927 B
C++

#pragma once
namespace snmalloc
{
void error(const char* const str);
}
// If simultating OE, then we need the underlying platform
#if !defined(OPEN_ENCLAVE) || defined(OPEN_ENCLAVE_SIMULATION)
# include "pal_free_bsd_kernel.h"
# include "pal_freebsd.h"
# include "pal_linux.h"
# include "pal_windows.h"
#endif
#include "pal_open_enclave.h"
#include "pal_plain.h"
namespace snmalloc
{
#if !defined(OPEN_ENCLAVE) || defined(OPEN_ENCLAVE_SIMULATION)
using DefaultPal =
# if defined(_WIN32)
PALWindows;
# elif defined(__linux__)
PALLinux;
# elif defined(FreeBSD_KERNEL)
PALFreeBSDKernel;
# elif defined(__FreeBSD__)
PALFBSD;
# endif
#endif
using Pal =
#ifdef OPEN_ENCLAVE
PALPlainMixin<PALOpenEnclave>;
#elif defined(SNMALLOC_MEMORY_PROVIDER)
PALPlainMixin<SNMALLOC_MEMORY_PROVIDER>;
#else
DefaultPal;
#endif
inline void error(const char* const str)
{
Pal::error(str);
}
}