[Bugfix][fast] Fix the get_num_blocks_touched logic (#6849)
This commit is contained in:
@@ -307,9 +307,8 @@ class NaiveBlockAllocator(BlockAllocator):
|
||||
# TODO(cade): make sure the logic is correct and clean it up.
|
||||
for block in blocks:
|
||||
if not block.is_full and num_lookahead_slots != 0:
|
||||
if block.num_empty_slots >= num_lookahead_slots:
|
||||
new_block_count += 1
|
||||
else:
|
||||
new_block_count += 1
|
||||
if num_lookahead_slots > block.num_empty_slots:
|
||||
new_block_count += cdiv(
|
||||
num_lookahead_slots - block.num_empty_slots,
|
||||
self._block_size)
|
||||
|
||||
Reference in New Issue
Block a user