uintptr_max instead of -1/~0
This commit is contained in:
committed by
Matthew Parkinson
parent
c471e1a271
commit
f1835813bd
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <limits>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <immintrin.h>
|
||||
|
||||
@@ -522,7 +522,7 @@ namespace snmalloc
|
||||
{
|
||||
if constexpr ((location == End) || (location == OnePastEnd))
|
||||
// We don't know the End, so return MAX_PTR
|
||||
return (uintptr_t)~0;
|
||||
return UINTPTR_MAX;
|
||||
else
|
||||
// We don't know the Start, so return MIN_PTR
|
||||
return 0;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace snmalloc
|
||||
}
|
||||
};
|
||||
|
||||
using SlabList = DLList<SlabLink, ~(uintptr_t)0>;
|
||||
using SlabList = DLList<SlabLink, UINTPTR_MAX>;
|
||||
|
||||
static_assert(
|
||||
sizeof(SlabLink) <= MIN_ALLOC_SIZE,
|
||||
|
||||
Reference in New Issue
Block a user