Fix multilist_alloc_t bug (not triggerable in real operation but still a bug)

This commit is contained in:
Vitaliy Filippov
2026-06-10 01:01:20 +03:00
parent 0e300f4c50
commit 236ffbb24e
4 changed files with 23 additions and 6 deletions
+13
View File
@@ -1902,6 +1902,19 @@ void test_alloc_buffer()
alloc.verify();
}
{
multilist_alloc_t alloc(100, 10);
alloc.use(50, 10);
alloc.verify();
// 48, 5 overlaps with 50, 10 -> should fail to allocate
bool ok = alloc.use(48, 5);
assert(!ok);
alloc.verify();
}
blockstore_heap_t heap(&dsk, buffer_area.data());
heap.finish_recheck();