Add an explicit invalid pointer type.

This is a generalisation of `std::nullptr_t` that allows non-0 values of
pointer-sized-but-not-a-pointer thing.  `DLList` now takes an
`InvalidPointer`, `nullptr_t`, or some other compatible class as a
sentinel value instead of a `uintptr_t`.
This commit is contained in:
David Chisnall
2019-04-29 11:22:40 +01:00
parent 4a0299ec77
commit 365571b2b8
2 changed files with 53 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ namespace snmalloc
}
};
using SlabList = DLList<SlabLink, UINTPTR_MAX>;
using SlabList = DLList<SlabLink, InvalidPointer<UINTPTR_MAX>>;
static_assert(
sizeof(SlabLink) <= MIN_ALLOC_SIZE,