mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx: rename MDBX_OSX_SPEED_INSTEADOF_DURABILITY option.
Change-Id: I1d0a05880507da0781ccd2bff5fa68610ad884a9
This commit is contained in:
parent
6f0a11f155
commit
e04bfc05fa
@ -25,8 +25,8 @@
|
||||
|
||||
#define MDBX_OSX_WANNA_DURABILITY 0 /* using fcntl(F_FULLFSYNC) with 5-10 times slowdown */
|
||||
#define MDBX_OSX_WANNA_SPEED 1 /* using fsync() with chance of data lost on power failure */
|
||||
#ifndef MDBX_OSX_SPEED_OR_DURABILITY
|
||||
#define MDBX_OSX_SPEED_OR_DURABILITY MDBX_OSX_WANNA_DURABILITY
|
||||
#ifndef MDBX_OSX_SPEED_INSTEADOF_DURABILITY
|
||||
#define MDBX_OSX_SPEED_INSTEADOF_DURABILITY MDBX_OSX_WANNA_DURABILITY
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
@ -669,7 +669,7 @@ int mdbx_filesync(mdbx_filehandle_t fd, enum mdbx_syncmode_bits mode_bits) {
|
||||
#else
|
||||
|
||||
#if defined(__APPLE__) && \
|
||||
MDBX_OSX_SPEED_OR_DURABILITY == MDBX_OSX_WANNA_DURABILITY
|
||||
MDBX_OSX_SPEED_INSTEADOF_DURABILITY == MDBX_OSX_WANNA_DURABILITY
|
||||
if (mode_bits & MDBX_SYNC_IODQ)
|
||||
return likely(fcntl(fd, F_FULLFSYNC) != -1) ? MDBX_SUCCESS : errno;
|
||||
#endif /* MacOS */
|
||||
@ -798,7 +798,7 @@ int mdbx_msync(mdbx_mmap_t *map, size_t offset, size_t length, int async) {
|
||||
const int mode = async ? MS_ASYNC : MS_SYNC;
|
||||
int rc = (msync(ptr, length, mode) == 0) ? MDBX_SUCCESS : errno;
|
||||
#if defined(__APPLE__) && \
|
||||
MDBX_OSX_SPEED_OR_DURABILITY == MDBX_OSX_WANNA_DURABILITY
|
||||
MDBX_OSX_SPEED_INSTEADOF_DURABILITY == MDBX_OSX_WANNA_DURABILITY
|
||||
if (rc == MDBX_SUCCESS && mode == MS_SYNC)
|
||||
rc = likely(fcntl(map->fd, F_FULLFSYNC) != -1) ? MDBX_SUCCESS : errno;
|
||||
#endif /* MacOS */
|
||||
|
Loading…
Reference in New Issue
Block a user