corealloc: spurious sizeof()

We mean to be allocating MIN_ALLOC_SIZE (== 2 * sizeof(void*)), not
sizeof(MIN_ALLOC_SIZE) (== sizeof(size_t)).  This doesn't matter in practice
since, well, MIN_ALLOC_SIZE is the minimum allocation size, and so requesting
either will have the same effect.  Still, best to say what we mean.
This commit is contained in:
Nathaniel Wesley Filardo
2021-08-12 12:01:36 +01:00
committed by Nathaniel Wesley Filardo
parent 7a02ae949f
commit 4501c0ed81

View File

@@ -146,9 +146,8 @@ namespace snmalloc
{
// Manufacture an allocation to prime the queue
// Using an actual allocation removes a conditional from a critical path.
auto dummy =
CapPtr<void, CBAlloc>(small_alloc_one(sizeof(MIN_ALLOC_SIZE)))
.template as_static<FreeObject>();
auto dummy = CapPtr<void, CBAlloc>(small_alloc_one(MIN_ALLOC_SIZE))
.template as_static<FreeObject>();
if (dummy == nullptr)
{
error("Critical error: Out-of-memory during initialisation.");