mdbx: refix #pragma pack for modern compilers and aligned-required arches (hotfix).

Fix a regression after the https://github.com/erthink/libmdbx/issues/235
This commit is contained in:
Leonid Yuriev 2021-10-12 16:19:00 +03:00
parent c9659e1aca
commit 30745e0621
2 changed files with 4 additions and 2 deletions

View File

@ -19249,7 +19249,7 @@ __cold int mdbx_dbi_dupsort_depthmask(MDBX_txn *txn, MDBX_dbi dbi,
break;
case F_DUPDATA | F_SUBDATA:
/* sub-tree */
*mask |= 1 << unaligned_peek_u16(1, &db->md_depth);
*mask |= 1 << UNALIGNED_PEEK_16(db, MDBX_db, md_depth);
break;
default:
mdbx_error("wrong node-flags %u", flags);
@ -19695,7 +19695,7 @@ static int dbi_open(MDBX_txn *txn, const char *table_name, unsigned user_flags,
/* Got info, register DBI in this txn */
memset(txn->mt_dbxs + slot, 0, sizeof(MDBX_dbx));
txn->mt_dbs[slot] = *(MDBX_db *)data.iov_base;
memcpy(&txn->mt_dbs[slot], data.iov_base, sizeof(MDBX_db));
env->me_dbflags[slot] = 0;
rc = mdbx_dbi_bind(txn, slot, user_flags, keycmp, datacmp);
if (unlikely(rc != MDBX_SUCCESS)) {

View File

@ -517,6 +517,8 @@ typedef struct MDBX_meta {
} MDBX_meta;
#pragma pack(1)
/* Common header for all page types. The page type depends on mp_flags.
*
* P_BRANCH and P_LEAF pages have unsorted 'MDBX_node's at the end, with