mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:34:13 +08:00
mdbx: disable by-default workaround for obsolete E2K bug.
Change-Id: I9d6aaf0154e3c9f03dab7948575f4792a13dc988
This commit is contained in:
parent
8ac13aba75
commit
60f4134841
17
mdbx.h
17
mdbx.h
@ -3512,16 +3512,10 @@ LIBMDBX_API int mdbx_get_attr(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key,
|
|||||||
#endif /* MDBX_NEXENTA_ATTRS */
|
#endif /* MDBX_NEXENTA_ATTRS */
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* LY: temporary workaround for Elbrus's memcmp() bug. */
|
* Workaround for mmaped-lookahead-cross-page-boundary bug
|
||||||
#ifndef __GLIBC_PREREQ
|
* in an obsolete versions of Elbrus's libc and kernels. */
|
||||||
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
|
#if defined(__e2k__) && defined(MDBX_E2K_MLHCPB_WORKAROUND) && \
|
||||||
#define __GLIBC_PREREQ(maj, min) \
|
MDBX_E2K_MLHCPB_WORKAROUND
|
||||||
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
|
|
||||||
#else
|
|
||||||
#define __GLIBC_PREREQ(maj, min) (0)
|
|
||||||
#endif
|
|
||||||
#endif /* __GLIBC_PREREQ */
|
|
||||||
#if defined(__e2k__) && !__GLIBC_PREREQ(2, 24)
|
|
||||||
LIBMDBX_API int mdbx_e2k_memcmp_bug_workaround(const void *s1, const void *s2,
|
LIBMDBX_API int mdbx_e2k_memcmp_bug_workaround(const void *s1, const void *s2,
|
||||||
size_t n);
|
size_t n);
|
||||||
LIBMDBX_API int mdbx_e2k_strcmp_bug_workaround(const char *s1, const char *s2);
|
LIBMDBX_API int mdbx_e2k_strcmp_bug_workaround(const char *s1, const char *s2);
|
||||||
@ -3544,8 +3538,7 @@ LIBMDBX_API size_t mdbx_e2k_strnlen_bug_workaround(const char *s,
|
|||||||
#define strlen mdbx_e2k_strlen_bug_workaround
|
#define strlen mdbx_e2k_strlen_bug_workaround
|
||||||
#undef strnlen
|
#undef strnlen
|
||||||
#define strnlen mdbx_e2k_strnlen_bug_workaround
|
#define strnlen mdbx_e2k_strnlen_bug_workaround
|
||||||
|
#endif /* MDBX_E2K_MLHCPB_WORKAROUND */
|
||||||
#endif /* Elbrus's memcmp() bug. */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -578,9 +578,10 @@ static __inline void get_key_optional(const MDBX_node *node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* LY: temporary workaround for Elbrus's memcmp() bug. */
|
* Workaround for mmaped-lookahead-cross-page-boundary bug
|
||||||
|
* in an obsolete versions of Elbrus's libc and kernels. */
|
||||||
#if defined(__e2k__) && !__GLIBC_PREREQ(2, 24)
|
#if defined(__e2k__) && defined(MDBX_E2K_MLHCPB_WORKAROUND) && \
|
||||||
|
MDBX_E2K_MLHCPB_WORKAROUND
|
||||||
int __hot mdbx_e2k_memcmp_bug_workaround(const void *s1, const void *s2,
|
int __hot mdbx_e2k_memcmp_bug_workaround(const void *s1, const void *s2,
|
||||||
size_t n) {
|
size_t n) {
|
||||||
if (unlikely(n > 42
|
if (unlikely(n > 42
|
||||||
@ -688,7 +689,7 @@ size_t __hot mdbx_e2k_strnlen_bug_workaround(const char *s, size_t maxlen) {
|
|||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
#endif /* Elbrus's memcmp() bug. */
|
#endif /* MDBX_E2K_MLHCPB_WORKAROUND */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* safe read/write volatile 64-bit fields on 32-bit architectures. */
|
* safe read/write volatile 64-bit fields on 32-bit architectures. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user