27 lines
999 B
Diff
27 lines
999 B
Diff
From 529a7cf3f5d5780d5e44c8508d2d42903672f7e8 Mon Sep 17 00:00:00 2001
|
|
From: root <root@localhost.localdomain>
|
|
Date: Tue, 9 Apr 2019 21:36:22 +0800
|
|
Subject: [PATCH 4/4] [space-map-disk] fix the search range (#117)
|
|
|
|
---
|
|
persistent-data/space-maps/disk.cc | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/persistent-data/space-maps/disk.cc b/persistent-data/space-maps/disk.cc
|
|
index ce6a42c..d8db76f 100644
|
|
--- a/persistent-data/space-maps/disk.cc
|
|
+++ b/persistent-data/space-maps/disk.cc
|
|
@@ -390,7 +390,8 @@ namespace {
|
|
|
|
bitmap bm(tm_, ie, bitmap_validator_);
|
|
unsigned bit_begin = (index == begin_index) ? (begin % ENTRIES_PER_BLOCK) : 0;
|
|
- unsigned bit_end = (index == end_index - 1) ? (end % ENTRIES_PER_BLOCK) : ENTRIES_PER_BLOCK;
|
|
+ unsigned bit_end = (index == end_index - 1) ?
|
|
+ (end - ENTRIES_PER_BLOCK * index) : ENTRIES_PER_BLOCK;
|
|
|
|
boost::optional<unsigned> maybe_b = bm.find_free(bit_begin, bit_end);
|
|
if (maybe_b) {
|
|
--
|
|
2.19.1
|
|
|