Improve code quality for alloc_size (#196)
* Improve code quality for alloc_size * Made error noreturn. * Update docs. * Move annoation
This commit is contained in:
committed by
GitHub
parent
fbbc2ddb76
commit
87dfd41553
@@ -49,7 +49,7 @@ namespace snmalloc
|
||||
DefaultPal;
|
||||
#endif
|
||||
|
||||
SNMALLOC_SLOW_PATH inline void error(const char* const str)
|
||||
[[noreturn]] SNMALLOC_SLOW_PATH inline void error(const char* const str)
|
||||
{
|
||||
Pal::error(str);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace snmalloc
|
||||
* PAL supports.
|
||||
*/
|
||||
static constexpr uint64_t pal_features = AlignedAllocation;
|
||||
void error(const char* const str)
|
||||
[[noreturn]] void error(const char* const str)
|
||||
{
|
||||
panic("snmalloc error: %s", str);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
extern "C" const void* __oe_get_heap_base();
|
||||
extern "C" const void* __oe_get_heap_end();
|
||||
extern "C" void* oe_memset_s(void* p, size_t p_size, int c, size_t size);
|
||||
extern "C" void oe_abort();
|
||||
extern "C" [[noreturn]] void oe_abort();
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace snmalloc
|
||||
* PAL supports.
|
||||
*/
|
||||
static constexpr uint64_t pal_features = 0;
|
||||
static void error(const char* const str)
|
||||
[[noreturn]] static void error(const char* const str)
|
||||
{
|
||||
UNUSED(str);
|
||||
oe_abort();
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace snmalloc
|
||||
/**
|
||||
* Report a fatal error an exit.
|
||||
*/
|
||||
static void error(const char* const str) noexcept
|
||||
[[noreturn]] static void error(const char* const str) noexcept
|
||||
{
|
||||
puts(str);
|
||||
print_stack_trace();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace snmalloc
|
||||
low_memory_callbacks.register_notification(callback);
|
||||
}
|
||||
|
||||
static void error(const char* const str)
|
||||
[[noreturn]] static void error(const char* const str)
|
||||
{
|
||||
puts(str);
|
||||
fflush(stdout);
|
||||
|
||||
Reference in New Issue
Block a user