Repository navigation
Upgrade upstream LMDB to 0.9.35 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,9 +128,21 @@ typedef SSIZE_T ssize_t; | |
| # define MDB_USE_ROBUST 1 | ||
| #elif defined(__APPLE__) || defined (BSD) || defined(__FreeBSD_kernel__) | ||
| # define MDB_USE_POSIX_SEM 1 | ||
| # define MDB_FDATASYNC fsync | ||
| # if defined(__APPLE__) | ||
| # define MDB_FDATASYNC(fd) fcntl(fd, F_FULLFSYNC) | ||
| # else | ||
| # define MDB_FDATASYNC fsync | ||
| # endif | ||
| #elif defined(ANDROID) | ||
| # define MDB_FDATASYNC fsync | ||
| #elif defined(__HAIKU__) | ||
| # define MDB_USE_POSIX_SEM 1 | ||
| # define MDB_FDATASYNC fsync | ||
| #endif | ||
|
|
||
| /* NetBSD does not define union semun in sys/sem.h */ | ||
| #if defined(__NetBSD__) && !defined(_SEM_SEMUN_UNDEFINED) | ||
| # define _SEM_SEMUN_UNDEFINED 1 | ||
| #endif | ||
|
|
||
| #ifndef _WIN32 | ||
|
|
@@ -2573,7 +2585,7 @@ mdb_env_sync(MDB_env *env, int force) | |
| ? MS_ASYNC : MS_SYNC; | ||
| if (MDB_MSYNC(env->me_map, env->me_mapsize, flags)) | ||
| rc = ErrCode(); | ||
| #ifdef _WIN32 | ||
| #if defined(_WIN32) || defined(__APPLE__) | ||
| else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd)) | ||
| rc = ErrCode(); | ||
| #endif | ||
|
|
@@ -2970,8 +2982,10 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) | |
| rc = mdb_txn_renew0(txn); | ||
| } | ||
| if (rc) { | ||
| if (txn != env->me_txn0) | ||
| if (txn != env->me_txn0) { | ||
| free(txn->mt_u.dirty_list); | ||
| free(txn); | ||
| } | ||
|
Comment on lines
2984
to
+2988
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an upstream bug in 0.9.34 and .35, created #44 to track. No action planned in this PR. |
||
| } else { | ||
| txn->mt_flags |= flags; /* could not change txn=me_txn0 earlier */ | ||
| *ret = txn; | ||
|
|
@@ -3072,6 +3086,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) | |
|
|
||
| txn->mt_numdbs = 0; | ||
| txn->mt_flags = MDB_TXN_FINISHED; | ||
| mdb_midl_free(txn->mt_spill_pgs); | ||
|
|
||
| if (!txn->mt_parent) { | ||
| mdb_midl_shrink(&txn->mt_free_pgs); | ||
|
|
@@ -3093,7 +3108,6 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) | |
| mdb_midl_free(txn->mt_free_pgs); | ||
| free(txn->mt_u.dirty_list); | ||
| } | ||
| mdb_midl_free(txn->mt_spill_pgs); | ||
|
|
||
| mdb_midl_free(pghead); | ||
| } | ||
|
|
@@ -8602,7 +8616,7 @@ mdb_cursor_del0(MDB_cursor *mc) | |
| goto fail; | ||
| } | ||
| if (m3->mc_xcursor && !(m3->mc_flags & C_EOF)) { | ||
| MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); | ||
| MDB_node *node = NODEPTR(m3->mc_pg[mc->mc_top], m3->mc_ki[mc->mc_top]); | ||
| /* If this node has dupdata, it may need to be reinited | ||
| * because its data has moved. | ||
| * If the xcursor was not initd it must be reinited. | ||
|
|
@@ -9170,8 +9184,8 @@ typedef struct mdb_copy { | |
| pthread_cond_t mc_cond; /**< Condition variable for #mc_new */ | ||
| char *mc_wbuf[2]; | ||
| char *mc_over[2]; | ||
| int mc_wlen[2]; | ||
| int mc_olen[2]; | ||
| size_t mc_wlen[2]; | ||
| size_t mc_olen[2]; | ||
| pgno_t mc_next_pgno; | ||
| HANDLE mc_fd; | ||
| int mc_toggle; /**< Buffer number in provider */ | ||
|
|
@@ -9188,7 +9202,8 @@ mdb_env_copythr(void *arg) | |
| { | ||
| mdb_copy *my = arg; | ||
| char *ptr; | ||
| int toggle = 0, wsize, rc; | ||
| int toggle = 0, rc; | ||
| size_t wsize; | ||
| #ifdef _WIN32 | ||
| DWORD len; | ||
| #define DO_WRITE(rc, fd, ptr, w2, len) rc = WriteFile(fd, ptr, w2, &len, NULL) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.