summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src
diff options
context:
space:
mode:
authorLeonid Yuriev <leo@yuriev.ru>2020-12-05 12:21:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-12-05 16:10:47 +0300
commitff95eede6a42ae9499e8857d208afd6d48bf1c71 (patch)
treee1c3e371ebd04d08bd0bd661245b40a2fe5e55d5 /libs/libmdbx/src
parentaffd5ca9f5664a2f2f1a131b5a5cac6595fb2fc2 (diff)
libmdbx: update to 0.9.2.12 with some useful fixes.
Diffstat (limited to 'libs/libmdbx/src')
-rw-r--r--libs/libmdbx/src/CMakeLists.txt14
-rw-r--r--libs/libmdbx/src/ChangeLog.md14
-rw-r--r--libs/libmdbx/src/README.md2
-rw-r--r--libs/libmdbx/src/VERSION2
-rw-r--r--libs/libmdbx/src/mdbx.c36
-rw-r--r--libs/libmdbx/src/mdbx.c++20
-rw-r--r--libs/libmdbx/src/mdbx.h63
-rw-r--r--libs/libmdbx/src/mdbx_chk.c6
-rw-r--r--libs/libmdbx/src/mdbx_copy.c6
-rw-r--r--libs/libmdbx/src/mdbx_dump.c6
-rw-r--r--libs/libmdbx/src/mdbx_load.c6
-rw-r--r--libs/libmdbx/src/mdbx_stat.c6
-rw-r--r--libs/libmdbx/src/ntdll.def2
13 files changed, 115 insertions, 68 deletions
diff --git a/libs/libmdbx/src/CMakeLists.txt b/libs/libmdbx/src/CMakeLists.txt
index d41686bf82..789fc4685a 100644
--- a/libs/libmdbx/src/CMakeLists.txt
+++ b/libs/libmdbx/src/CMakeLists.txt
@@ -340,12 +340,14 @@ if(NOT DEFINED MDBX_CXX_STANDARD)
set(MDBX_CXX_STANDARD 98)
endif()
endif()
-# MSVC >= 19.28 (Microsoft Visual Studio 16.8) is mad!
-# It unable process Windows SDK headers in the C11 mode!
-if(HAS_C11 LESS 0 OR (MSVC AND MSVC_VERSION GREATER 1927))
- set(MDBX_C_STANDARD 99)
-else()
- set(MDBX_C_STANDARD 11)
+if(NOT DEFINED MDBX_C_STANDARD)
+ # MSVC >= 19.28 (Microsoft Visual Studio 16.8) is mad!
+ # It unable process Windows SDK headers in the C11 mode!
+ if(HAS_C11 LESS 0 OR (MSVC AND MSVC_VERSION GREATER 1927))
+ set(MDBX_C_STANDARD 99)
+ else()
+ set(MDBX_C_STANDARD 11)
+ endif()
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def")
diff --git a/libs/libmdbx/src/ChangeLog.md b/libs/libmdbx/src/ChangeLog.md
index e7cf79534f..66c5de3705 100644
--- a/libs/libmdbx/src/ChangeLog.md
+++ b/libs/libmdbx/src/ChangeLog.md
@@ -3,6 +3,7 @@ ChangeLog
## v0.9.3 (in development)
+TODO:
- Engage new terminology (https://github.com/erthink/libmdbx/issues/137).
- Rework/speedup the implementation of the dirty page list (lazy compactification, lazy sorting via merge).
- Resolve few TODOs (https://github.com/erthink/libmdbx/issues/123, https://github.com/erthink/libmdbx/issues/124,
@@ -11,6 +12,18 @@ ChangeLog
- Finalize C++ API (few typos and trivia bugs are still likely for now).
- Packages for ROSA Linux, ALT Linux, Fedora/RHEL, Debian/Ubuntu.
+Acknowledgements:
+ - Mahlon E. Smith (http://www.martini.nu/) for FreeBSD port of libmdbx.
+ - 장세연 (http://www.castis.com) for bug fixing and PR.
+
+Added features:
+ - Package for FreeBSD is available now by Mahlon E. Smith.
+
+Fixes:
+ - Fixed missing cleanup (null assigned) in the C++ commit/abort (https://github.com/erthink/libmdbx/pull/143).
+ - Fixed `mdbx_realloc()` for case of nullptr and `MDBX_AVOID_CRT=ON` for Windows.
+
+
## v0.9.2 scheduled at 2020-11-27
Acknowledgements:
@@ -58,6 +71,7 @@ Fixes:
- Fixed large pages checking (for compatibility and to avoid false-positive errors from `mdbx_chk`).
- Added workaround for Wine (https://github.com/miranda-ng/miranda-ng/issues/1209).
- Fixed `ERROR_NOT_SUPPORTED` while opening DB by UNC pathnames (https://github.com/miranda-ng/miranda-ng/issues/2627).
+ - Added handling `EXCEPTION_POSSIBLE_DEADLOCK` condition for Windows.
## v0.9.1 2020-09-30
diff --git a/libs/libmdbx/src/README.md b/libs/libmdbx/src/README.md
index 3f643d2706..799c993c91 100644
--- a/libs/libmdbx/src/README.md
+++ b/libs/libmdbx/src/README.md
@@ -155,7 +155,7 @@ transaction journal. No crash recovery needed. No maintenance is required.
- **Page size**: a power of 2, maximum `65536` bytes, default `4096` bytes.
- **Key size**: minimum 0, maximum ≈¼ pagesize (`1300` bytes for default 4K pagesize, `21780` bytes for 64K pagesize).
-- **Value size**: minimum 0, maximum `2146435072` (`0x7FF00000`) bytes for maps, ≈¼ pagesize for multimaps (`1348` bytes default 4K pagesize, `21828` bytes for 64K pagesize).
+- **Value size**: minimum 0, maximum `2146435072` (`0x7FF00000`) bytes for maps, ≈¼ pagesize for multimaps (`1348` bytes for default 4K pagesize, `21828` bytes for 64K pagesize).
- **Write transaction size**: up to `4194301` (`0x3FFFFD`) pages (16 [GiB](https://en.wikipedia.org/wiki/Gibibyte) for default 4K pagesize, 256 [GiB](https://en.wikipedia.org/wiki/Gibibyte) for 64K pagesize).
- **Database size**: up to `2147483648` pages (8 [TiB](https://en.wikipedia.org/wiki/Tebibyte) for default 4K pagesize, 128 [TiB](https://en.wikipedia.org/wiki/Tebibyte) for 64K pagesize).
- **Maximum sub-databases**: `32765`.
diff --git a/libs/libmdbx/src/VERSION b/libs/libmdbx/src/VERSION
index 594150e32c..418c133552 100644
--- a/libs/libmdbx/src/VERSION
+++ b/libs/libmdbx/src/VERSION
@@ -1 +1 @@
-0.9.2.0
+0.9.2.12
diff --git a/libs/libmdbx/src/mdbx.c b/libs/libmdbx/src/mdbx.c
index 3bcb83b536..7901b0b90d 100644
--- a/libs/libmdbx/src/mdbx.c
+++ b/libs/libmdbx/src/mdbx.c
@@ -12,7 +12,7 @@
* <http://www.OpenLDAP.org/license.html>. */
#define MDBX_ALLOY 1
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -680,6 +680,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -714,7 +715,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
@@ -14865,7 +14867,7 @@ static int mdbx_cursor_sibling(MDBX_cursor *mc, int dir) {
}
} else {
assert((dir - 1) == -1 || (dir - 1) == 1);
- mc->mc_ki[mc->mc_top] += dir - 1;
+ mc->mc_ki[mc->mc_top] += (indx_t)(dir - 1);
mdbx_debug("just moving to %s index key %u",
(dir == SIBLING_RIGHT) ? "right" : "left",
mc->mc_ki[mc->mc_top]);
@@ -14940,7 +14942,7 @@ static int mdbx_cursor_next(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
const int numkeys = page_numkeys(mp);
if (unlikely(ki >= numkeys)) {
mdbx_debug("%s", "=====> move to next sibling page");
- mc->mc_ki[mc->mc_top] = numkeys - 1;
+ mc->mc_ki[mc->mc_top] = (indx_t)(numkeys - 1);
if (unlikely((rc = mdbx_cursor_sibling(mc, SIBLING_RIGHT)) !=
MDBX_SUCCESS)) {
mc->mc_flags |= C_EOF;
@@ -23566,7 +23568,15 @@ MDBX_INTERNAL_FUNC int mdbx_fastmutex_destroy(mdbx_fastmutex_t *fastmutex) {
MDBX_INTERNAL_FUNC int mdbx_fastmutex_acquire(mdbx_fastmutex_t *fastmutex) {
#if defined(_WIN32) || defined(_WIN64)
- EnterCriticalSection(fastmutex);
+ __try {
+ EnterCriticalSection(fastmutex);
+ } __except (
+ (GetExceptionCode() ==
+ 0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
+ ? EXCEPTION_EXECUTE_HANDLER
+ : EXCEPTION_CONTINUE_SEARCH) {
+ return ERROR_POSSIBLE_DEADLOCK;
+ }
return MDBX_SUCCESS;
#else
return pthread_mutex_lock(fastmutex);
@@ -25413,9 +25423,9 @@ __dll_export
0,
9,
2,
- 0,
- {"2020-11-27T10:09:03+03:00", "481b41a5b377ff247625bd2cec60c0ca84f2f2f5", "092ab094c4f8e7c704030568db62bad5d106755f",
- "v0.9.2-0-g092ab09"},
+ 12,
+ {"2020-12-05T09:45:03+03:00", "455c7d633b3e490fe4f1e8c9999adccdf358f699", "3e7459b428373404e3c8ce238bd4061fa9d18f79",
+ "v0.9.2-12-g3e7459b4"},
sourcery};
__dll_export
@@ -25576,7 +25586,15 @@ int mdbx_txn_lock(MDBX_env *env, bool dontwait) {
if (!TryEnterCriticalSection(&env->me_windowsbug_lock))
return MDBX_BUSY;
} else {
- EnterCriticalSection(&env->me_windowsbug_lock);
+ __try {
+ EnterCriticalSection(&env->me_windowsbug_lock);
+ }
+ __except ((GetExceptionCode() ==
+ 0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
+ ? EXCEPTION_EXECUTE_HANDLER
+ : EXCEPTION_CONTINUE_SEARCH) {
+ return ERROR_POSSIBLE_DEADLOCK;
+ }
}
if ((env->me_flags & MDBX_EXCLUSIVE) ||
diff --git a/libs/libmdbx/src/mdbx.c++ b/libs/libmdbx/src/mdbx.c++
index e3c3552b39..4f54ad8efb 100644
--- a/libs/libmdbx/src/mdbx.c++
+++ b/libs/libmdbx/src/mdbx.c++
@@ -12,7 +12,7 @@
* <http://www.OpenLDAP.org/license.html>. */
#define MDBX_ALLOY 1
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -680,6 +680,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -714,7 +715,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
@@ -4343,20 +4345,18 @@ txn_managed::~txn_managed() noexcept {
void txn_managed::abort() {
const error err = static_cast<MDBX_error_t>(::mdbx_txn_abort(handle_));
- if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) {
- if (err.code() != MDBX_THREAD_MISMATCH)
- handle_ = nullptr;
+ if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH))
+ handle_ = nullptr;
+ if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS))
err.throw_exception();
- }
}
void txn_managed::commit() {
const error err = static_cast<MDBX_error_t>(::mdbx_txn_commit(handle_));
- if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) {
- if (err.code() != MDBX_THREAD_MISMATCH)
- handle_ = nullptr;
+ if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH))
+ handle_ = nullptr;
+ if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS))
err.throw_exception();
- }
}
//------------------------------------------------------------------------------
diff --git a/libs/libmdbx/src/mdbx.h b/libs/libmdbx/src/mdbx.h
index 966cf2e701..2a6a2d7893 100644
--- a/libs/libmdbx/src/mdbx.h
+++ b/libs/libmdbx/src/mdbx.h
@@ -306,7 +306,7 @@ typedef mode_t mdbx_mode_t;
#define MDBX_NOTHROW_CONST_FUNCTION [[const]]
#else
#define MDBX_NOTHROW_CONST_FUNCTION MDBX_NOTHROW_PURE_FUNCTION
-#endif /* MDBX_NOTHROW_PURE_FUNCTION */
+#endif /* MDBX_NOTHROW_CONST_FUNCTION */
#ifndef MDBX_DEPRECATED /* may be predefined to avoid warnings "deprecated" */
#ifdef __deprecated
@@ -375,8 +375,8 @@ typedef mode_t mdbx_mode_t;
#endif
#endif /* bool without __cplusplus */
-#if !defined(__cpp_noexcept_function_type) || \
- __cpp_noexcept_function_type < 201510L
+#if !defined(DOXYGEN) && (!defined(__cpp_noexcept_function_type) || \
+ __cpp_noexcept_function_type < 201510L)
#define MDBX_CXX17_NOEXCEPT
#else
#define MDBX_CXX17_NOEXCEPT noexcept
@@ -386,12 +386,13 @@ typedef mode_t mdbx_mode_t;
#if !defined(__cplusplus)
#define MDBX_CXX01_CONSTEXPR __inline
#define MDBX_CXX01_CONSTEXPR_VAR const
-#elif !defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
- (defined(__LCC__) && __LCC__ < 124) || \
- (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
- !defined(__clang__) && !defined(__LCC__)) || \
- (defined(_MSC_VER) && _MSC_VER < 1910) || \
- (defined(__clang__) && __clang_major__ < 4)
+#elif !defined(DOXYGEN) && \
+ (!defined(__cpp_constexpr) || __cpp_constexpr < 200704L || \
+ (defined(__LCC__) && __LCC__ < 124) || \
+ (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407) && \
+ !defined(__clang__) && !defined(__LCC__)) || \
+ (defined(_MSC_VER) && _MSC_VER < 1910) || \
+ (defined(__clang__) && __clang_major__ < 4))
#define MDBX_CXX01_CONSTEXPR inline
#define MDBX_CXX01_CONSTEXPR_VAR const
#else
@@ -402,12 +403,13 @@ typedef mode_t mdbx_mode_t;
#if !defined(__cplusplus)
#define MDBX_CXX11_CONSTEXPR __inline
#define MDBX_CXX11_CONSTEXPR_VAR const
-#elif !defined(__cpp_constexpr) || __cpp_constexpr < 201304 || \
- (defined(__LCC__) && __LCC__ < 124) || \
- (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
- !defined(__LCC__)) || \
- (defined(_MSC_VER) && _MSC_VER < 1910) || \
- (defined(__clang__) && __clang_major__ < 5)
+#elif !defined(DOXYGEN) && \
+ (!defined(__cpp_constexpr) || __cpp_constexpr < 201304 || \
+ (defined(__LCC__) && __LCC__ < 124) || \
+ (defined(__GNUC__) && __GNUC__ < 6 && !defined(__clang__) && \
+ !defined(__LCC__)) || \
+ (defined(_MSC_VER) && _MSC_VER < 1910) || \
+ (defined(__clang__) && __clang_major__ < 5))
#define MDBX_CXX11_CONSTEXPR inline
#define MDBX_CXX11_CONSTEXPR_VAR const
#else
@@ -418,11 +420,12 @@ typedef mode_t mdbx_mode_t;
#if !defined(__cplusplus)
#define MDBX_CXX14_CONSTEXPR __inline
#define MDBX_CXX14_CONSTEXPR_VAR const
-#elif defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
- ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
- (defined(__clang__) && __clang_major__ > 4) || \
- (defined(__GNUC__) && __GNUC__ > 6) || \
- (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
+#elif defined(DOXYGEN) || \
+ defined(__cpp_constexpr) && __cpp_constexpr >= 201304L && \
+ ((defined(_MSC_VER) && _MSC_VER >= 1910) || \
+ (defined(__clang__) && __clang_major__ > 4) || \
+ (defined(__GNUC__) && __GNUC__ > 6) || \
+ (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
#define MDBX_CXX14_CONSTEXPR constexpr
#define MDBX_CXX14_CONSTEXPR_VAR constexpr
#else
@@ -477,27 +480,25 @@ typedef mode_t mdbx_mode_t;
#define DEFINE_ENUM_FLAG_OPERATORS(ENUM) \
extern "C++" { \
MDBX_CXX01_CONSTEXPR ENUM operator|(ENUM a, ENUM b) { \
- return ENUM(std::size_t(a) | std::size_t(b)); \
+ return ENUM(unsigned(a) | unsigned(b)); \
} \
MDBX_CXX14_CONSTEXPR ENUM &operator|=(ENUM &a, ENUM b) { return a = a | b; } \
MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, ENUM b) { \
- return ENUM(std::size_t(a) & std::size_t(b)); \
+ return ENUM(unsigned(a) & unsigned(b)); \
} \
- MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, size_t b) { \
- return ENUM(std::size_t(a) & b); \
+ MDBX_CXX01_CONSTEXPR ENUM operator&(ENUM a, unsigned b) { \
+ return ENUM(unsigned(a) & b); \
} \
- MDBX_CXX01_CONSTEXPR ENUM operator&(size_t a, ENUM b) { \
- return ENUM(a & std::size_t(b)); \
+ MDBX_CXX01_CONSTEXPR ENUM operator&(unsigned a, ENUM b) { \
+ return ENUM(a & unsigned(b)); \
} \
MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, ENUM b) { return a = a & b; } \
- MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, size_t b) { \
+ MDBX_CXX14_CONSTEXPR ENUM &operator&=(ENUM &a, unsigned b) { \
return a = a & b; \
} \
- MDBX_CXX01_CONSTEXPR std::size_t operator~(ENUM a) { \
- return ~std::size_t(a); \
- } \
+ MDBX_CXX01_CONSTEXPR unsigned operator~(ENUM a) { return ~unsigned(a); } \
MDBX_CXX01_CONSTEXPR ENUM operator^(ENUM a, ENUM b) { \
- return ENUM(std::size_t(a) ^ std::size_t(b)); \
+ return ENUM(unsigned(a) ^ unsigned(b)); \
} \
MDBX_CXX14_CONSTEXPR ENUM &operator^=(ENUM &a, ENUM b) { return a = a ^ b; } \
}
diff --git a/libs/libmdbx/src/mdbx_chk.c b/libs/libmdbx/src/mdbx_chk.c
index 194bde6f9a..dd505dd96c 100644
--- a/libs/libmdbx/src/mdbx_chk.c
+++ b/libs/libmdbx/src/mdbx_chk.c
@@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -702,6 +702,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -736,7 +737,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
diff --git a/libs/libmdbx/src/mdbx_copy.c b/libs/libmdbx/src/mdbx_copy.c
index eb3c49d1d9..cde9923308 100644
--- a/libs/libmdbx/src/mdbx_copy.c
+++ b/libs/libmdbx/src/mdbx_copy.c
@@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -702,6 +702,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -736,7 +737,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
diff --git a/libs/libmdbx/src/mdbx_dump.c b/libs/libmdbx/src/mdbx_dump.c
index 96cf69c47a..c51247a121 100644
--- a/libs/libmdbx/src/mdbx_dump.c
+++ b/libs/libmdbx/src/mdbx_dump.c
@@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -702,6 +702,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -736,7 +737,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
diff --git a/libs/libmdbx/src/mdbx_load.c b/libs/libmdbx/src/mdbx_load.c
index 3a49a60ec7..d1ac7e9238 100644
--- a/libs/libmdbx/src/mdbx_load.c
+++ b/libs/libmdbx/src/mdbx_load.c
@@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -702,6 +702,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -736,7 +737,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
diff --git a/libs/libmdbx/src/mdbx_stat.c b/libs/libmdbx/src/mdbx_stat.c
index ce47bd75fd..aa5d501728 100644
--- a/libs/libmdbx/src/mdbx_stat.c
+++ b/libs/libmdbx/src/mdbx_stat.c
@@ -34,7 +34,7 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>. */
-#define MDBX_BUILD_SOURCERY 47492323531afee427a3de6ddaeae26eed45bfd1b52d92fd121a5a13a9747dbb_v0_9_2_0_g092ab09
+#define MDBX_BUILD_SOURCERY b30bc0044d83cd1275fa00662c8265e39091a931353b79a46d21c9536795acb2_v0_9_2_12_g3e7459b4
#ifdef MDBX_CONFIG_H
#include MDBX_CONFIG_H
#endif
@@ -702,6 +702,7 @@ __extern_C key_t ftok(const char *, int);
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#include <excpt.h>
#include <tlhelp32.h>
#include <windows.h>
#include <winnt.h>
@@ -736,7 +737,8 @@ static inline void *mdbx_calloc(size_t nelem, size_t size) {
#ifndef mdbx_realloc
static inline void *mdbx_realloc(void *ptr, size_t bytes) {
- return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
+ return ptr ? LocalReAlloc(ptr, bytes, LMEM_MOVEABLE)
+ : LocalAlloc(LMEM_FIXED, bytes);
}
#endif /* mdbx_realloc */
diff --git a/libs/libmdbx/src/ntdll.def b/libs/libmdbx/src/ntdll.def
index e3a6e33c94..f974ea6380 100644
--- a/libs/libmdbx/src/ntdll.def
+++ b/libs/libmdbx/src/ntdll.def
@@ -1242,3 +1242,5 @@ wcsstr
wcstol
wcstombs
wcstoul
+__C_specific_handler
+_except_handler4_common