mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-20 10:48:56 +08:00
mdbx: rework using of mdbx_mmap_t and mdbx_msync().
This commit is contained in:
15
src/bits.h
15
src/bits.h
@@ -659,12 +659,13 @@ typedef struct MDBX_pgstate {
|
||||
struct MDBX_env {
|
||||
#define MDBX_ME_SIGNATURE UINT32_C(0x9A899641)
|
||||
size_t me_signature;
|
||||
mdbx_filehandle_t me_fd; /* The main data file */
|
||||
mdbx_filehandle_t me_lfd; /* The lock file */
|
||||
#ifdef MDBX_OSAL_SECTION
|
||||
MDBX_OSAL_SECTION me_dxb_section;
|
||||
MDBX_OSAL_SECTION me_lck_section;
|
||||
#endif
|
||||
mdbx_mmap_t me_dxb_mmap; /* The main data file */
|
||||
mdbx_mmap_t me_lck_mmap; /* The lock file */
|
||||
#define me_map me_dxb_mmap.dxb
|
||||
#define me_lck me_lck_mmap.lck
|
||||
#define me_fd me_dxb_mmap.fd
|
||||
#define me_lfd me_lck_mmap.fd
|
||||
|
||||
/* Failed to update the meta page. Probably an I/O error. */
|
||||
#define MDBX_FATAL_ERROR UINT32_C(0x80000000)
|
||||
/* Some fields are initialized. */
|
||||
@@ -684,8 +685,6 @@ struct MDBX_env {
|
||||
mdbx_pid_t me_pid; /* process ID of this env */
|
||||
mdbx_thread_key_t me_txkey; /* thread-key for readers */
|
||||
char *me_path; /* path to the DB files */
|
||||
char *me_map; /* the memory map of the data file */
|
||||
MDBX_lockinfo *me_lck; /* the memory map of the lock file, never NULL */
|
||||
void *me_pbuf; /* scratch area for DUPSORT put() */
|
||||
MDBX_txn *me_txn; /* current write transaction */
|
||||
MDBX_txn *me_txn0; /* prealloc'd write transaction */
|
||||
|
Reference in New Issue
Block a user