mirror of
https://github.com/isar/libmdbx.git
synced 2025-09-05 01:12:21 +08:00
mdbx: rework/fix unaligned access.
Change-Id: Ib0208e78786ac84551384ed57ac580fe0717840e
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1273,11 +1273,13 @@ typedef struct MDBX_node {
|
||||
uint32_t mn_dsize;
|
||||
uint32_t mn_pgno32;
|
||||
};
|
||||
uint16_t mn_flags; /* see mdbx_node */
|
||||
uint8_t mn_flags; /* see mdbx_node flags */
|
||||
uint8_t mn_extra;
|
||||
uint16_t mn_ksize; /* key size */
|
||||
#else
|
||||
uint16_t mn_ksize; /* key size */
|
||||
uint16_t mn_flags; /* see mdbx_node */
|
||||
uint8_t mn_extra;
|
||||
uint8_t mn_flags; /* see mdbx_node flags */
|
||||
union {
|
||||
uint32_t mn_pgno32;
|
||||
uint32_t mn_dsize;
|
||||
|
@@ -267,8 +267,11 @@ typedef pthread_mutex_t mdbx_fastmutex_t;
|
||||
#endif /* all x86 */
|
||||
|
||||
#if !defined(MDBX_UNALIGNED_OK)
|
||||
#if (defined(__ia32__) || defined(__e2k__) || \
|
||||
defined(__ARM_FEATURE_UNALIGNED)) && \
|
||||
#if defined(_MSC_VER)
|
||||
#define MDBX_UNALIGNED_OK 1 /* avoid MSVC misoptimization */
|
||||
#elif __CLANG_PREREQ(5, 0) || __GNUC_PREREQ(5, 0)
|
||||
#define MDBX_UNALIGNED_OK 0 /* expecting optimization is well done */
|
||||
#elif (defined(__ia32__) || defined(__ARM_FEATURE_UNALIGNED)) && \
|
||||
!defined(__ALIGNED__)
|
||||
#define MDBX_UNALIGNED_OK 1
|
||||
#else
|
||||
|
Reference in New Issue
Block a user