mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 05:58:21 +08:00
mdbx: Merge branch 'devel' into 'pt' branch.
Change-Id: Ieac23894deaffdc5e5e5110471f0491e0605c7d8
This commit is contained in:
commit
787aeea162
12
mdb.c
12
mdb.c
@ -809,11 +809,17 @@ typedef struct MDB_dbx {
|
||||
void *md_relctx; /**< user-provided context for md_rel */
|
||||
} MDB_dbx;
|
||||
|
||||
#if MDBX_MODE_ENABLED
|
||||
# define MDBX_MODE_SALT 0
|
||||
#else
|
||||
# define MDBX_MODE_SALT 1115449266
|
||||
#endif
|
||||
|
||||
/** A database transaction.
|
||||
* Every operation requires a transaction handle.
|
||||
*/
|
||||
struct MDB_txn {
|
||||
#define MDBX_MT_SIGNATURE 0x93D53A31
|
||||
#define MDBX_MT_SIGNATURE (0x93D53A31^MDBX_MODE_SALT)
|
||||
unsigned mt_signature;
|
||||
MDB_txn *mt_parent; /**< parent of a nested txn */
|
||||
/** Nested txn under this txn, set together with flag #MDB_TXN_HAS_CHILD */
|
||||
@ -922,7 +928,7 @@ struct MDB_xcursor;
|
||||
* (A node with #F_DUPDATA but no #F_SUBDATA contains a subpage).
|
||||
*/
|
||||
struct MDB_cursor {
|
||||
#define MDBX_MC_SIGNATURE 0xFE05D5B1
|
||||
#define MDBX_MC_SIGNATURE (0xFE05D5B1^MDBX_MODE_SALT)
|
||||
unsigned mc_signature;
|
||||
/** Next cursor on this DB in this txn */
|
||||
MDB_cursor *mc_next;
|
||||
@ -988,7 +994,7 @@ struct MDB_rthc {
|
||||
};
|
||||
/** The database environment. */
|
||||
struct MDB_env {
|
||||
#define MDBX_ME_SIGNATURE 0x9A899641
|
||||
#define MDBX_ME_SIGNATURE (0x9A899641^MDBX_MODE_SALT)
|
||||
unsigned me_signature;
|
||||
HANDLE me_fd; /**< The main data file */
|
||||
HANDLE me_lfd; /**< The lock file */
|
||||
|
10
mdb_chk.c
10
mdb_chk.c
@ -74,9 +74,13 @@ struct {
|
||||
short *pagemap;
|
||||
size_t total_payload_bytes;
|
||||
size_t pgcount;
|
||||
} walk = {
|
||||
.dbi_names = { "@gc" }
|
||||
};
|
||||
} walk;
|
||||
|
||||
static __attribute__((constructor))
|
||||
void init_walk(void)
|
||||
{
|
||||
walk.dbi_names[0] = "@gc";
|
||||
}
|
||||
|
||||
size_t total_unused_bytes;
|
||||
int exclusive = 2;
|
||||
|
6
mtest1.c
6
mtest1.c
@ -74,7 +74,7 @@ int main(int argc,char * argv[])
|
||||
env_oflags = 0;
|
||||
}
|
||||
/* LY: especially here we always needs MDB_NOSYNC
|
||||
* for testing mdb_env_close_ex() and "redo-to-steady" on open. */
|
||||
* for testing mdbx_env_close_ex() and "redo-to-steady" on open. */
|
||||
env_oflags |= MDB_NOSYNC;
|
||||
E(mdb_env_open(env, DBPATH, env_oflags, 0664));
|
||||
|
||||
@ -159,7 +159,7 @@ int main(int argc,char * argv[])
|
||||
|
||||
mdb_dbi_close(env, dbi);
|
||||
/********************* LY: kept DB dirty ****************/
|
||||
mdb_env_close_ex(env, 1);
|
||||
mdbx_env_close_ex(env, 1);
|
||||
E(mdb_env_create(&env));
|
||||
E(mdb_env_set_maxdbs(env, 4));
|
||||
E(mdb_env_open(env, DBPATH, env_oflags, 0664));
|
||||
@ -194,7 +194,7 @@ int main(int argc,char * argv[])
|
||||
mdb_txn_abort(txn);
|
||||
|
||||
mdb_dbi_close(env, dbi);
|
||||
mdb_env_close_ex(env, 0);
|
||||
mdbx_env_close_ex(env, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user