mdbx: Merge branch 'master' into 'nexenta'.

Change-Id: I02fda0d3bc0d14ee7a4f19e03329ef03b1497cd8
This commit is contained in:
Leo Yuriev 2016-07-29 00:40:57 +03:00
commit 78da60dedd
2 changed files with 11 additions and 10 deletions

6
lmdb.h
View File

@ -341,7 +341,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel
#define MDB_REVERSEKEY 0x02
/** use sorted duplicates */
#define MDB_DUPSORT 0x04
/** numeric keys in native byte order: either unsigned int or size_t.
/** numeric keys in native byte order, either unsigned int or #mdb_size_t.
* (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.)
* The keys must all be of the same size. */
#define MDB_INTEGERKEY 0x08
/** with #MDB_DUPSORT, sorted dup items have fixed size */
@ -1181,7 +1182,8 @@ int mdb_txn_renew(MDB_txn *txn);
* keys must be unique and may have only a single data item.
* <li>#MDB_INTEGERKEY
* Keys are binary integers in native byte order, either unsigned int
* or size_t, and will be sorted as such.
* or #mdb_size_t, and will be sorted as such.
* (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.)
* The keys must all be of the same size.
* <li>#MDB_DUPFIXED
* This flag may only be used in combination with #MDB_DUPSORT. This option

15
mdb.c
View File

@ -5399,10 +5399,8 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl)
if (tx2->mt_spill_pgs) {
MDB_ID pn = pgno << 1;
x = mdb_midl_search(tx2->mt_spill_pgs, pn);
if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) {
p = (MDB_page *)(env->me_map + env->me_psize * pgno);
goto done;
}
if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn)
goto mapped;
}
if (dl[0].mid) {
unsigned x = mdb_mid2l_search(dl, pgno);
@ -5415,14 +5413,15 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl)
} while ((tx2 = tx2->mt_parent) != NULL);
}
if (likely(pgno < txn->mt_next_pgno)) {
level = 0;
p = (MDB_page *)(env->me_map + env->me_psize * pgno);
} else {
if (unlikely(pgno >= txn->mt_next_pgno)) {
mdb_debug("page %zu not found", pgno);
txn->mt_flags |= MDB_TXN_ERROR;
return MDB_PAGE_NOTFOUND;
}
level = 0;
mapped:
p = (MDB_page *)(env->me_map + env->me_psize * pgno);
done:
*ret = p;