From f315066d7872bdc5c756ebf1c38bd9e19091aaa4 Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Wed, 19 Mar 2025 00:43:10 -0700 Subject: [PATCH] Fix default max allocs Old default didn't pass the check in `with_max_allocs` in the `NI = u16` case. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 98ab025..8c875f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,7 +141,7 @@ where /// Creates a new allocator, managing a contiguous block of memory of `size` /// units, with a default reasonable number of maximum allocations. pub fn new(size: u32) -> Self { - Allocator::with_max_allocs(size, u32::min(128 * 1024, NI::MAX - 1)) + Allocator::with_max_allocs(size, u32::min(128 * 1024, NI::MAX - 2)) } /// Creates a new allocator, managing a contiguous block of memory of `size`