mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 19:04:12 +08:00
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:
parent
c9659e1aca
commit
30745e0621
@ -19249,7 +19249,7 @@ __cold int mdbx_dbi_dupsort_depthmask(MDBX_txn *txn, MDBX_dbi dbi,
|
|||||||
break;
|
break;
|
||||||
case F_DUPDATA | F_SUBDATA:
|
case F_DUPDATA | F_SUBDATA:
|
||||||
/* sub-tree */
|
/* sub-tree */
|
||||||
*mask |= 1 << unaligned_peek_u16(1, &db->md_depth);
|
*mask |= 1 << UNALIGNED_PEEK_16(db, MDBX_db, md_depth);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mdbx_error("wrong node-flags %u", flags);
|
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 */
|
/* Got info, register DBI in this txn */
|
||||||
memset(txn->mt_dbxs + slot, 0, sizeof(MDBX_dbx));
|
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;
|
env->me_dbflags[slot] = 0;
|
||||||
rc = mdbx_dbi_bind(txn, slot, user_flags, keycmp, datacmp);
|
rc = mdbx_dbi_bind(txn, slot, user_flags, keycmp, datacmp);
|
||||||
if (unlikely(rc != MDBX_SUCCESS)) {
|
if (unlikely(rc != MDBX_SUCCESS)) {
|
||||||
|
@ -517,6 +517,8 @@ typedef struct MDBX_meta {
|
|||||||
|
|
||||||
} MDBX_meta;
|
} MDBX_meta;
|
||||||
|
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
/* Common header for all page types. The page type depends on mp_flags.
|
/* 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
|
* P_BRANCH and P_LEAF pages have unsorted 'MDBX_node's at the end, with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user