Improve check_bounds init check.

This commit is contained in:
Matthew Parkinson
2022-01-10 10:34:28 +00:00
committed by Matthew Parkinson
parent 419347ba4a
commit ef64f6c31b
5 changed files with 26 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ namespace
auto& alloc = ThreadAlloc::get();
void* p = const_cast<void*>(ptr);
if (SNMALLOC_UNLIKELY(alloc.remaining_bytes(ptr) < len))
if (SNMALLOC_UNLIKELY(!alloc.check_bounds(ptr, len)))
{
if constexpr (FailFast)
{