Enable guard pages in CHECK_CLIENT

Change the behaviour to use PROT_NONE for reservations in CHECK_CLIENT
mode.  This means that we only provide access once data is actually
being used.
This commit is contained in:
Matthew Parkinson
2021-07-16 16:35:54 +01:00
committed by Matthew Parkinson
parent 02d2ab8f7e
commit 9df0101dfd
12 changed files with 45 additions and 51 deletions

View File

@@ -114,12 +114,6 @@ namespace snmalloc
# endif
#endif
// // The CHECK_CLIENT macro is used to turn on minimal checking of the client
// // calling the API correctly.
// #if !defined(NDEBUG) && !defined(CHECK_CLIENT)
// # define CHECK_CLIENT
// #endif
inline SNMALLOC_FAST_PATH void check_client_error(const char* const str)
{
//[[clang::musttail]]
@@ -132,7 +126,7 @@ check_client_impl(bool test, const char* const str)
if (unlikely(!test))
check_client_error(str);
}
#ifdef CHECK_CLIENT
#ifdef SNMALLOC_CHECK_CLIENT
# define check_client(test, str) check_client_impl(test, str)
#else
# define check_client(test, str)

View File

@@ -73,7 +73,7 @@ namespace snmalloc
}
};
#ifdef CHECK_CLIENT
#ifdef SNMALLOC_CHECK_CLIENT
template<size_t length, typename T>
class ModArray
{