mdbx: reset length of PNL before shrinking.

This commit is contained in:
Leo Yuriev 2018-08-28 23:18:41 +03:00
parent 7498286e3a
commit e7da946fac

View File

@ -678,6 +678,7 @@ static unsigned __hot mdbx_pnl_search(MDBX_PNL pnl, pgno_t id) {
* [in,out] ppl Address of the PNL to shrink. */
static void mdbx_pnl_shrink(MDBX_PNL *ppl) {
MDBX_PNL pl = *ppl - 1;
pl[1] = 0;
if (unlikely(*pl > MDBX_LIST_MAX)) {
/* shrink to MDBX_LIST_MAX */
pl = realloc(pl, (MDBX_LIST_MAX + 2) * sizeof(pgno_t));