summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src/mdbx.c++
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libmdbx/src/mdbx.c++')
-rw-r--r--libs/libmdbx/src/mdbx.c++20
1 files changed, 10 insertions, 10 deletions
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();
- }
}
//------------------------------------------------------------------------------