Skip double allocs when reading journal

This commit is contained in:
Vitaliy Filippov
2021-04-03 00:53:28 +03:00
parent f4769ba7c7
commit ad9f619370
6 changed files with 57 additions and 9 deletions
+8
View File
@@ -20,7 +20,15 @@ void alloc_all(int size)
{
printf("incorrect block allocated: expected %d, got %lu\n", i, x);
}
if (a->get(x))
{
printf("not free before set at %d\n", i);
}
a->set(x, true);
if (!a->get(x))
{
printf("free after set at %d\n", i);
}
}
uint64_t x = a->find_free();
if (x != UINT64_MAX)