mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
rearrange STL allocator code: remove pragma, ifdef for C++11
This commit is contained in:
parent
2d54553b7a
commit
7a9502973d
4 changed files with 25 additions and 35 deletions
|
@ -167,6 +167,11 @@ bool _mi_page_is_valid(mi_page_t* page);
|
|||
|
||||
// Overflow detecting multiply
|
||||
static inline bool mi_mul_overflow(size_t count, size_t size, size_t* total) {
|
||||
// quick check for the case where count is one (common for C++ allocators)
|
||||
if (count==1) {
|
||||
*total = size;
|
||||
return false;
|
||||
}
|
||||
#if __has_builtin(__builtin_umul_overflow) || __GNUC__ >= 5
|
||||
#include <limits.h> // UINT_MAX, ULONG_MAX
|
||||
#if (SIZE_MAX == UINT_MAX)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue