mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 19:34:15 +08:00
mdbx: fix page-boundary checking inside accelerated scan4seq()
.
This commit is contained in:
parent
d6603a0c0a
commit
3de759a7be
@ -6015,7 +6015,7 @@ scan4seq_avx2(pgno_t *range, const size_t len, const unsigned seq) {
|
|||||||
#else
|
#else
|
||||||
const unsigned on_page_safe_mask = 0xfe0 /* enough for '-31' bytes offset */;
|
const unsigned on_page_safe_mask = 0xfe0 /* enough for '-31' bytes offset */;
|
||||||
#endif
|
#endif
|
||||||
if (likely(on_page_safe_mask & (uintptr_t)range)) {
|
if (likely(on_page_safe_mask & (uintptr_t)(range + offset))) {
|
||||||
const unsigned extra = (unsigned)(detent + 8 - range);
|
const unsigned extra = (unsigned)(detent + 8 - range);
|
||||||
assert(extra > 0 && extra < 8);
|
assert(extra > 0 && extra < 8);
|
||||||
mask = 0xFF << extra;
|
mask = 0xFF << extra;
|
||||||
@ -6092,7 +6092,7 @@ scan4seq_sse2(pgno_t *range, const size_t len, const unsigned seq) {
|
|||||||
#else
|
#else
|
||||||
const unsigned on_page_safe_mask = 0xff0 /* enough for '-15' bytes offset */;
|
const unsigned on_page_safe_mask = 0xff0 /* enough for '-15' bytes offset */;
|
||||||
#endif
|
#endif
|
||||||
if (likely(on_page_safe_mask & (uintptr_t)range)) {
|
if (likely(on_page_safe_mask & (uintptr_t)(range + offset))) {
|
||||||
const unsigned extra = (unsigned)(detent + 4 - range);
|
const unsigned extra = (unsigned)(detent + 4 - range);
|
||||||
assert(extra > 0 && extra < 4);
|
assert(extra > 0 && extra < 4);
|
||||||
mask = 0xF << extra;
|
mask = 0xF << extra;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user