From f1835813bd355029c01a4a3e952a60ccd2f102cb Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 26 Apr 2019 17:00:24 +0100 Subject: [PATCH] uintptr_max instead of -1/~0 --- src/ds/bits.h | 1 + src/mem/alloc.h | 2 +- src/mem/metaslab.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ds/bits.h b/src/ds/bits.h index 109eb26..960b3a3 100644 --- a/src/ds/bits.h +++ b/src/ds/bits.h @@ -1,6 +1,7 @@ #pragma once #include +#include #ifdef _MSC_VER # include diff --git a/src/mem/alloc.h b/src/mem/alloc.h index 52b7379..b59e4c9 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.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; diff --git a/src/mem/metaslab.h b/src/mem/metaslab.h index ba99f81..020a11c 100644 --- a/src/mem/metaslab.h +++ b/src/mem/metaslab.h @@ -19,7 +19,7 @@ namespace snmalloc } }; - using SlabList = DLList; + using SlabList = DLList; static_assert( sizeof(SlabLink) <= MIN_ALLOC_SIZE,