Skip to content

Commit eacc027

Browse files
committed
save
1 parent a73a7db commit eacc027

File tree

15 files changed

+942
-492
lines changed

15 files changed

+942
-492
lines changed

libmdbx/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ BTC `bc1qzvl9uegf2ea6cwlytnanrscyv8snwsvrc0xfsu`, SOL `FTCTgbHajoLVZGr8aEFWMzx3N
104104

105105
- Устранены лишние операции синхронизации данных с диском при выделении страниц при почти полном заполнении БД.
106106

107+
- В утилите `mdbx_load` устранены ошибки загрузки значений нулевой длины и обмен параметров shrink/growth в геометрии БД.
108+
107109
Изменение поведения:
108110

109111
- Вновь включена/разрешена на старых ядрах Linux, начиная с версии 3.16, так как сейчас уже нет причин отказываться от работы на 3.16 поддерживая при этом ядра 4.x, и еще есть проекты (Isar, Isar-Community, Hive) которым требуется такая поддержка.
@@ -124,6 +126,8 @@ BTC `bc1qzvl9uegf2ea6cwlytnanrscyv8snwsvrc0xfsu`, SOL `FTCTgbHajoLVZGr8aEFWMzx3N
124126

125127
- Запрещено открытие существующих таблиц с отличающимися флагами, если только явно не задана опция `MDBX_DB_ACCEDE`.
126128

129+
- В формируемые утилитой `mdbx_dump` дампы теперь не выводиться текущий размер БД и `maxreaders`, чтобы содержимое дампа зависело только от содержимого БД.
130+
127131
Прочие доработки:
128132

129133
- Доработана логика отказа от использования OFD-блокировок на POSIX-платформах.

libmdbx/VERSION.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "git_describe": "v0.14.1-389-gd5175913", "git_timestamp": "2026-02-05T17:57:15+03:00", "git_tree": "3d97f9bfc5a342d9ce60bc137b2e4b64ae862566", "git_commit": "d517591324ccdc3d48750374ff65f5ef03cb1fdd", "semver": "0.14.1.389" }
1+
{ "git_describe": "v0.14.1-428-g6569bd09", "git_timestamp": "2026-02-24T16:49:25+03:00", "git_tree": "431749603b89ba0b8b319ddce6339ded30611c37", "git_commit": "6569bd097c1d88174bcaee0d173aa12600034947", "semver": "0.14.1.428" }

libmdbx/config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.1-389-gd5175913 at 2026-02-05T17:57:15+03:00),
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.1-428-g6569bd09 at 2026-02-24T16:49:25+03:00),
22
* it is the template for libmdbx's config.h
33
******************************************************************************/
44

libmdbx/mdbx-internals.h

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This file is part of the libmdbx amalgamated source code (v0.14.1-389-gd5175913 at 2026-02-05T17:57:15+03:00).
1+
/* This file is part of the libmdbx amalgamated source code (v0.14.1-428-g6569bd09 at 2026-02-24T16:49:25+03:00).
22
*
33
* libmdbx (aka MDBX) is an extremely fast, compact, powerful, embeddedable, transactional key-value storage engine with
44
* open-source code. MDBX has a specific set of properties and capabilities, focused on creating unique lightweight
@@ -24,7 +24,7 @@
2424

2525
#define xMDBX_ALLOY 1 /* alloyed build */
2626

27-
#define MDBX_BUILD_SOURCERY ada3e97b23b38bc24478dd09b1bc2f7430d5b6b731285309c7294921f3d628a2_v0_14_1_389_gd5175913
27+
#define MDBX_BUILD_SOURCERY e1b0e3d3dfd6db79e6b76995f4387eded3f83975b0c552b3c5fe9e16f563f21e_v0_14_1_428_g6569bd09
2828

2929
#define LIBMDBX_INTERNALS
3030
#define MDBX_DEPRECATED
@@ -1795,6 +1795,22 @@ MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline uint32_t osal_bswap32
17951795
#error MDBX_DPL_PREALLOC_FOR_RADIXSORT must be defined as 0 or 1
17961796
#endif /* MDBX_DPL_PREALLOC_FOR_RADIXSORT */
17971797

1798+
#ifndef MDBX_DML_PREALLOC_FOR_RADIXSORT
1799+
#define MDBX_DML_PREALLOC_FOR_RADIXSORT 1
1800+
#elif !(MDBX_DML_PREALLOC_FOR_RADIXSORT == 0 || MDBX_DML_PREALLOC_FOR_RADIXSORT == 1)
1801+
#error MDBX_DML_PREALLOC_FOR_RADIXSORT must be defined as 0 or 1
1802+
#endif /* MDBX_DML_PREALLOC_FOR_RADIXSORT */
1803+
1804+
#ifndef MDBX_DPL_CACHE_NPAGES
1805+
#if MDBX_WORDBITS >= 64
1806+
#define MDBX_DPL_CACHE_NPAGES 1
1807+
#else
1808+
#define MDBX_DPL_CACHE_NPAGES 0
1809+
#endif
1810+
#elif !(MDBX_DPL_CACHE_NPAGES == 0 || MDBX_DPL_CACHE_NPAGES == 1)
1811+
#error MDBX_DPL_CACHE_NPAGES must be defined as 0 or 1
1812+
#endif /* MDBX_DPL_CACHE_NPAGES */
1813+
17981814
/** Controls dirty pages tracking, spilling and persisting in `MDBX_WRITEMAP`.
17991815
*
18001816
* \details In other words, disables in-memory database updating with consequent
@@ -1935,6 +1951,20 @@ MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline uint32_t osal_bswap32
19351951
#error MDBX_ENABLE_FAKE_NESTED_READONLY_TRANSACTIONS must be defined as 0 or 1
19361952
#endif /* MDBX_ENABLE_FAKE_NESTED_READONLY_TRANSACTIONS */
19371953

1954+
/** Forces rounding size of memory mapped regions and files to system allocation granularity rather to system page size.
1955+
*
1956+
* \details In most operating systems, RAM is allocated in larger chunks consisting of several pages.
1957+
* Thus, rounding up to the size of the system page, rather than the actual size of the block used
1958+
* for memory allocation, does not save resources, but only hides what is really happening.
1959+
* On the other hand, system allocation granularity may depend not only on the type of operating system,
1960+
* but also on the version, settings, and amount of available resources (RAM), so increasing the rounding
1961+
* unit may lead to doubtful and unexpected behavior for the user. */
1962+
#ifndef MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY
1963+
#define MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY 0
1964+
#elif !(MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY == 0 || MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY == 1)
1965+
#error MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY must be defined as 0 or 1
1966+
#endif /* MDBX_ROUNDING_TO_ALLOCATION_GRANULARITY */
1967+
19381968
//------------------------------------------------------------------------------
19391969

19401970
/** Win32 File Locking API for \ref MDBX_LOCKING */
@@ -3316,7 +3346,7 @@ typedef const pgno_t *const_pnl_t;
33163346
#define MDBX_PNL_LEAST(pl) MDBX_PNL_LAST(pl)
33173347
#define MDBX_PNL_MOST(pl) MDBX_PNL_FIRST(pl)
33183348
#define MDBX_PNL_CONTIGUOUS(prev, next, span) (((prev) - (next)) == (span))
3319-
#endif
3349+
#endif /* MDBX_PNL_ASCENDING */
33203350

33213351
#ifndef __cplusplus
33223352

@@ -3372,11 +3402,15 @@ MDBX_MAYBE_UNUSED MDBX_INTERNAL pnl_t pnl_clone(const const_pnl_t src);
33723402

33733403
MDBX_INTERNAL int pnl_reserve(pnl_t __restrict *__restrict ppnl, const size_t wanna);
33743404

3375-
MDBX_MAYBE_UNUSED static inline int __must_check_result pnl_need(pnl_t __restrict *__restrict ppnl, size_t num) {
3376-
assert(pnl_size(*ppnl) <= PAGELIST_LIMIT && pnl_alloclen(*ppnl) >= pnl_size(*ppnl));
3377-
assert(num <= PAGELIST_LIMIT);
3378-
const size_t wanna = pnl_size(*ppnl) + num;
3379-
return likely(pnl_alloclen(*ppnl) >= wanna) ? MDBX_SUCCESS : pnl_reserve(ppnl, wanna);
3405+
MDBX_MAYBE_UNUSED static inline int __must_check_result pnl_need(pnl_t __restrict *__restrict ppnl, size_t more) {
3406+
if (likely(*ppnl)) {
3407+
assert(pnl_size(*ppnl) <= PAGELIST_LIMIT && pnl_alloclen(*ppnl) >= pnl_size(*ppnl));
3408+
assert(more <= PAGELIST_LIMIT);
3409+
more += pnl_size(*ppnl);
3410+
if (likely(pnl_alloclen(*ppnl) >= more))
3411+
return MDBX_SUCCESS;
3412+
}
3413+
return pnl_reserve(ppnl, more);
33803414
}
33813415

33823416
MDBX_MAYBE_UNUSED static inline void pnl_append_prereserved(__restrict pnl_t pnl, pgno_t pgno) {
@@ -3438,10 +3472,39 @@ MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline size_t pnl_search(con
34383472
return n;
34393473
}
34403474

3475+
MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline bool pnl_contains(const const_pnl_t pnl, pgno_t pgno,
3476+
size_t limit) {
3477+
size_t n = pnl_search(pnl, pgno, limit);
3478+
return n > 0 && n <= pnl_size(pnl) && pnl[n] == pgno;
3479+
}
3480+
3481+
MDBX_NOTHROW_PURE_FUNCTION MDBX_MAYBE_UNUSED static inline bool pnl_contains_span(const const_pnl_t pnl, pgno_t pgno,
3482+
pgno_t span) {
3483+
size_t n = pnl_search_nochk(pnl, pgno);
3484+
#if MDBX_PNL_ASCENDING
3485+
#error "FIXME"
3486+
#else
3487+
return n >= span && pnl[n] == pgno && MDBX_PNL_CONTIGUOUS(pnl[n - span + 1], pnl[n], span - 1);
3488+
#endif /* MDBX_PNL_ASCENDING */
3489+
}
3490+
34413491
MDBX_INTERNAL size_t pnl_merge(pnl_t dst, const const_pnl_t src);
34423492

34433493
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION MDBX_INTERNAL size_t pnl_maxspan(const const_pnl_t pnl);
34443494

3495+
MDBX_MAYBE_UNUSED MDBX_NOTHROW_PURE_FUNCTION static inline size_t pnl_scan_span(const const_pnl_t pnl,
3496+
const size_t from) {
3497+
size_t span = 1;
3498+
assert(from > 0 && from <= pnl_size(pnl));
3499+
while (from + span <= pnl_size(pnl) && MDBX_PNL_CONTIGUOUS(pnl[from], pnl[from + span], span))
3500+
++span;
3501+
return span;
3502+
}
3503+
3504+
MDBX_MAYBE_UNUSED MDBX_INTERNAL pgno_t pnl_get_best_sequence(const pnl_t pnl, const size_t span,
3505+
const pgno_t defrag_detent);
3506+
MDBX_MAYBE_UNUSED MDBX_INTERNAL pgno_t pnl_crop_tail_sequence(const pnl_t pnl);
3507+
34453508
#endif /* !__cplusplus */
34463509

34473510
#ifdef __cplusplus

0 commit comments

Comments
 (0)