Refactor checks to improve codegen.
This commit is contained in:
committed by
Matthew Parkinson
parent
0983f1837b
commit
ed615eade9
@@ -8,6 +8,22 @@ namespace snmalloc
|
||||
// calling the API correctly.
|
||||
#if !defined(NDEBUG) && !defined(CHECK_CLIENT)
|
||||
# define CHECK_CLIENT
|
||||
#endif
|
||||
|
||||
SNMALLOC_FAST_PATH void check_client_impl(bool test, const char* const str)
|
||||
{
|
||||
#ifdef CHECK_CLIENT
|
||||
if (unlikely(!test))
|
||||
error(str);
|
||||
#else
|
||||
UNUSED(test);
|
||||
UNUSED(str);
|
||||
#endif
|
||||
}
|
||||
#ifdef CHECK_CLIENT
|
||||
# define check_client(test, str) check_client_impl(test, str)
|
||||
#else
|
||||
# define check_client(test, str)
|
||||
#endif
|
||||
|
||||
// 0 intermediate bits results in power of 2 small allocs. 1 intermediate
|
||||
|
||||
Reference in New Issue
Block a user