mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 03:24:13 +08:00
mdbx: использование clang-format-19.
This commit is contained in:
parent
cda8ebe0bd
commit
5c40f6983c
13
mdbx.h++
13
mdbx.h++
@ -2255,14 +2255,16 @@ public:
|
|||||||
|
|
||||||
buffer(const char *c_str, bool make_reference,
|
buffer(const char *c_str, bool make_reference,
|
||||||
const allocator_type &allocator = allocator_type())
|
const allocator_type &allocator = allocator_type())
|
||||||
: buffer(::mdbx::slice(c_str), make_reference, allocator) {}
|
: buffer(::mdbx::slice(c_str), make_reference, allocator){}
|
||||||
|
|
||||||
#if defined(DOXYGEN) || \
|
#if defined(DOXYGEN) || \
|
||||||
(defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
|
(defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
|
||||||
template <class CHAR, class T>
|
template <class CHAR, class T>
|
||||||
buffer(const ::std::basic_string_view<CHAR, T> &view, bool make_reference,
|
buffer(const ::std::basic_string_view<CHAR, T> &view,
|
||||||
|
bool make_reference,
|
||||||
const allocator_type &allocator = allocator_type())
|
const allocator_type &allocator = allocator_type())
|
||||||
: buffer(::mdbx::slice(view), make_reference, allocator) {}
|
: buffer(::mdbx::slice(view), make_reference, allocator) {
|
||||||
|
}
|
||||||
#endif /* __cpp_lib_string_view >= 201606L */
|
#endif /* __cpp_lib_string_view >= 201606L */
|
||||||
|
|
||||||
MDBX_CXX20_CONSTEXPR
|
MDBX_CXX20_CONSTEXPR
|
||||||
@ -2288,7 +2290,7 @@ public:
|
|||||||
|
|
||||||
MDBX_CXX20_CONSTEXPR
|
MDBX_CXX20_CONSTEXPR
|
||||||
buffer(const char *c_str, const allocator_type &allocator = allocator_type())
|
buffer(const char *c_str, const allocator_type &allocator = allocator_type())
|
||||||
: buffer(::mdbx::slice(c_str), allocator) {}
|
: buffer(::mdbx::slice(c_str), allocator){}
|
||||||
|
|
||||||
#if defined(DOXYGEN) || \
|
#if defined(DOXYGEN) || \
|
||||||
(defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
|
(defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
|
||||||
@ -2296,7 +2298,8 @@ public:
|
|||||||
MDBX_CXX20_CONSTEXPR
|
MDBX_CXX20_CONSTEXPR
|
||||||
buffer(const ::std::basic_string_view<CHAR, T> &view,
|
buffer(const ::std::basic_string_view<CHAR, T> &view,
|
||||||
const allocator_type &allocator = allocator_type())
|
const allocator_type &allocator = allocator_type())
|
||||||
: buffer(::mdbx::slice(view), allocator) {}
|
: buffer(::mdbx::slice(view), allocator) {
|
||||||
|
}
|
||||||
#endif /* __cpp_lib_string_view >= 201606L */
|
#endif /* __cpp_lib_string_view >= 201606L */
|
||||||
|
|
||||||
buffer(size_t head_room, size_t tail_room,
|
buffer(size_t head_room, size_t tail_room,
|
||||||
|
@ -505,7 +505,7 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
|
|
||||||
#ifndef container_of
|
#ifndef container_of
|
||||||
#define container_of(ptr, type, member) \
|
#define container_of(ptr, type, member) \
|
||||||
((type *)((char *)(ptr)-offsetof(type, member)))
|
((type *)((char *)(ptr) - offsetof(type, member)))
|
||||||
#endif /* container_of */
|
#endif /* container_of */
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
@ -428,7 +428,7 @@ node_largedata_pgno(const MDBX_node *const __restrict node) {
|
|||||||
* max(DATALEN_NO_OVERFLOW, sizeof(MDBX_db));
|
* max(DATALEN_NO_OVERFLOW, sizeof(MDBX_db));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PAGEROOM(pagesize) ((pagesize)-PAGEHDRSZ)
|
#define PAGEROOM(pagesize) ((pagesize) - PAGEHDRSZ)
|
||||||
#define EVEN_FLOOR(n) ((n) & ~(size_t)1)
|
#define EVEN_FLOOR(n) ((n) & ~(size_t)1)
|
||||||
#define BRANCH_NODE_MAX(pagesize) \
|
#define BRANCH_NODE_MAX(pagesize) \
|
||||||
(EVEN_FLOOR((PAGEROOM(pagesize) - sizeof(indx_t) - NODESIZE) / (3 - 1) - \
|
(EVEN_FLOOR((PAGEROOM(pagesize) - sizeof(indx_t) - NODESIZE) / (3 - 1) - \
|
||||||
@ -3787,7 +3787,9 @@ MDBX_MAYBE_UNUSED static bool cursor_is_tracked(const MDBX_cursor *mc) {
|
|||||||
} \
|
} \
|
||||||
tracked->mc_next = *tracking_head; \
|
tracked->mc_next = *tracking_head; \
|
||||||
*tracking_head = tracked; \
|
*tracking_head = tracked; \
|
||||||
{ act; } \
|
{ \
|
||||||
|
act; \
|
||||||
|
} \
|
||||||
*tracking_head = tracked->mc_next; \
|
*tracking_head = tracked->mc_next; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ typedef struct MDBX_page {
|
|||||||
#define P_LOOSE 0x4000u /* page was dirtied then freed, can be reused */
|
#define P_LOOSE 0x4000u /* page was dirtied then freed, can be reused */
|
||||||
#define P_FROZEN 0x8000u /* used for retire page with known status */
|
#define P_FROZEN 0x8000u /* used for retire page with known status */
|
||||||
#define P_ILL_BITS \
|
#define P_ILL_BITS \
|
||||||
((uint16_t) ~(P_BRANCH | P_LEAF | P_LEAF2 | P_OVERFLOW | P_SPILLED))
|
((uint16_t)~(P_BRANCH | P_LEAF | P_LEAF2 | P_OVERFLOW | P_SPILLED))
|
||||||
uint16_t mp_flags;
|
uint16_t mp_flags;
|
||||||
union {
|
union {
|
||||||
uint32_t mp_pages; /* number of overflow pages */
|
uint32_t mp_pages; /* number of overflow pages */
|
||||||
|
@ -1660,8 +1660,7 @@ __cold ::std::ostream &operator<<(::std::ostream &out,
|
|||||||
{env_managed::geometry::MB, "MB"},
|
{env_managed::geometry::MB, "MB"},
|
||||||
{env_managed::geometry::KiB, "KiB"},
|
{env_managed::geometry::KiB, "KiB"},
|
||||||
{env_managed::geometry::kB, "kB"},
|
{env_managed::geometry::kB, "kB"},
|
||||||
{1, " bytes"}
|
{1, " bytes"}};
|
||||||
};
|
|
||||||
|
|
||||||
for (const auto i : scales)
|
for (const auto i : scales)
|
||||||
if (bytes % i.one == 0)
|
if (bytes % i.one == 0)
|
||||||
|
@ -3398,8 +3398,7 @@ __cold int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages,
|
|||||||
#elif defined(HW_USERMEM) || defined(HW_PHYSMEM64) || defined(HW_MEMSIZE) || \
|
#elif defined(HW_USERMEM) || defined(HW_PHYSMEM64) || defined(HW_MEMSIZE) || \
|
||||||
defined(HW_PHYSMEM)
|
defined(HW_PHYSMEM)
|
||||||
size_t ram, len = sizeof(ram);
|
size_t ram, len = sizeof(ram);
|
||||||
static const int mib[] = {
|
static const int mib[] = {CTL_HW,
|
||||||
CTL_HW,
|
|
||||||
#if defined(HW_USERMEM)
|
#if defined(HW_USERMEM)
|
||||||
HW_USERMEM
|
HW_USERMEM
|
||||||
#elif defined(HW_PHYSMEM64)
|
#elif defined(HW_PHYSMEM64)
|
||||||
@ -3448,8 +3447,7 @@ __cold int mdbx_get_sysraminfo(intptr_t *page_size, intptr_t *total_pages,
|
|||||||
#elif defined(VM_TOTAL) || defined(VM_METER)
|
#elif defined(VM_TOTAL) || defined(VM_METER)
|
||||||
struct vmtotal info;
|
struct vmtotal info;
|
||||||
size_t len = sizeof(info);
|
size_t len = sizeof(info);
|
||||||
static const int mib[] = {
|
static const int mib[] = {CTL_VM,
|
||||||
CTL_VM,
|
|
||||||
#if defined(VM_TOTAL)
|
#if defined(VM_TOTAL)
|
||||||
VM_TOTAL
|
VM_TOTAL
|
||||||
#elif defined(VM_METER)
|
#elif defined(VM_METER)
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#define IP_PRINTF_ARG_HOST(addr) \
|
#define IP_PRINTF_ARG_HOST(addr) \
|
||||||
(int)((addr) >> 24), (int)((addr) >> 16 & 0xff), (int)((addr) >> 8 & 0xff), \
|
(int)((addr) >> 24), (int)((addr) >> 16 & 0xff), (int)((addr) >> 8 & 0xff), \
|
||||||
(int)((addr)&0xff)
|
(int)((addr) & 0xff)
|
||||||
|
|
||||||
char opt_db_path[PATH_MAX] = "./mdbx_bench2";
|
char opt_db_path[PATH_MAX] = "./mdbx_bench2";
|
||||||
static MDBX_env *env;
|
static MDBX_env *env;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user