uintptr_max instead of -1/~0

This commit is contained in:
Matthew Parkinson
2019-04-26 17:00:24 +01:00
committed by Matthew Parkinson
parent c471e1a271
commit f1835813bd
3 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <stddef.h>
#include <limits>
#ifdef _MSC_VER
# include <immintrin.h>

View File

@@ -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;

View File

@@ -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,