Skip to content

Commit 0971120

Browse files
author
Ilya Mikheev
committed
new 0.13.9 version
1 parent f8885bc commit 0971120

20 files changed

Lines changed: 4449 additions & 5014 deletions

libmdbx/CMakeLists.txt

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
132132
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/preface.h"
133133
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/proto.h"
134134
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/refund.c"
135-
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/rkl.c"
136-
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/rkl.h"
137135
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/sort.h"
138136
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/spill.c"
139137
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/spill.h"
@@ -151,9 +149,6 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
151149
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/tree-ops.c"
152150
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txl.c"
153151
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txl.h"
154-
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txn-basal.c"
155-
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txn-nested.c"
156-
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txn-ro.c"
157152
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/txn.c"
158153
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/unaligned.h"
159154
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/utils.c"
@@ -579,9 +574,8 @@ if(WIN32 AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def")
579574
if(MSVC)
580575
if(NOT MSVC_LIB_EXE)
581576
# Find lib.exe
582-
get_filename_component(CL_NAME ${CMAKE_C_COMPILER} NAME)
583-
string(REPLACE cl.exe lib.exe MSVC_LIB_EXE ${CL_NAME})
584-
find_program(MSVC_LIB_EXE ${MSVC_LIB_EXE})
577+
get_filename_component(CC_DIR ${CMAKE_C_COMPILER} DIRECTORY)
578+
find_program(MSVC_LIB_EXE "lib.exe" HINTS ${CC_DIR})
585579
endif()
586580
if(MSVC_LIB_EXE)
587581
message(STATUS "Found MSVC's lib tool: ${MSVC_LIB_EXE}")
@@ -593,25 +587,24 @@ if(WIN32 AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def")
593587
COMMAND ${MSVC_LIB_EXE} /def:"${MDBX_SOURCE_DIR}/ntdll.def" /out:"${MDBX_NTDLL_EXTRA_IMPLIB}"
594588
${INITIAL_CMAKE_STATIC_LINKER_FLAGS})
595589
else()
596-
message(WARNING "MSVC's lib tool not found")
590+
message(WARNING "MSVC's lib.exe not found")
597591
endif()
598592
elseif(MINGW OR MINGW64)
599-
if(NOT DLLTOOL)
600-
# Find dlltool
601-
get_filename_component(GCC_NAME ${CMAKE_C_COMPILER} NAME)
602-
string(REPLACE gcc dlltool DLLTOOL_NAME ${GCC_NAME})
603-
find_program(DLLTOOL NAMES ${DLLTOOL_NAME})
593+
if(NOT MINGW_DLLTOOL_EXE)
594+
# Find dlltool.exe
595+
get_filename_component(CC_DIR ${CMAKE_C_COMPILER} DIRECTORY)
596+
find_program(MINGW_DLLTOOL_EXE "dlltool.exe" HINTS ${CC_DIR})
604597
endif()
605-
if(DLLTOOL)
606-
message(STATUS "Found dlltool: ${DLLTOOL}")
598+
if(MINGW_DLLTOOL_EXE)
599+
message(STATUS "Found MINGW's dlltool: ${MINGW_DLLTOOL_EXE}")
607600
set(MDBX_NTDLL_EXTRA_IMPLIB "${CMAKE_CURRENT_BINARY_DIR}/mdbx_ntdll_extra.a")
608601
add_custom_command(
609602
OUTPUT "${MDBX_NTDLL_EXTRA_IMPLIB}"
610603
COMMENT "Create extra-import-library for ntdll.dll"
611604
MAIN_DEPENDENCY "${MDBX_SOURCE_DIR}/ntdll.def"
612-
COMMAND ${DLLTOOL} -d "${MDBX_SOURCE_DIR}/ntdll.def" -l "${MDBX_NTDLL_EXTRA_IMPLIB}")
605+
COMMAND ${MINGW_DLLTOOL_EXE} -d "${MDBX_SOURCE_DIR}/ntdll.def" -l "${MDBX_NTDLL_EXTRA_IMPLIB}")
613606
else()
614-
message(WARNING "dlltool not found")
607+
message(WARNING "MINGW's dlltool.exe not found")
615608
endif()
616609
endif()
617610

@@ -707,6 +700,8 @@ mark_as_advanced(MDBX_ENABLE_PROFGC)
707700
add_option(MDBX ENABLE_DBI_SPARSE
708701
"Support for sparse sets of DBI handles to reduce overhead when starting and processing transactions" ON)
709702
add_option(MDBX ENABLE_DBI_LOCKFREE "Support for deferred releasing and a lockfree path to quickly open DBI handles" ON)
703+
add_option(MDBX USE_FALLOCATE "Using posix_fallocate() or fcntl(F_PREALLOCATE) on OSX" AUTO)
704+
mark_as_advanced(MDBX_USE_FALLOCATE)
710705

711706
if(NOT MDBX_AMALGAMATED_SOURCE)
712707
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "DEBUG")
@@ -834,8 +829,6 @@ else()
834829
"${MDBX_SOURCE_DIR}/preface.h"
835830
"${MDBX_SOURCE_DIR}/proto.h"
836831
"${MDBX_SOURCE_DIR}/refund.c"
837-
"${MDBX_SOURCE_DIR}/rkl.c"
838-
"${MDBX_SOURCE_DIR}/rkl.h"
839832
"${MDBX_SOURCE_DIR}/sort.h"
840833
"${MDBX_SOURCE_DIR}/spill.c"
841834
"${MDBX_SOURCE_DIR}/spill.h"
@@ -845,9 +838,6 @@ else()
845838
"${MDBX_SOURCE_DIR}/tree-ops.c"
846839
"${MDBX_SOURCE_DIR}/txl.c"
847840
"${MDBX_SOURCE_DIR}/txl.h"
848-
"${MDBX_SOURCE_DIR}/txn-basal.c"
849-
"${MDBX_SOURCE_DIR}/txn-nested.c"
850-
"${MDBX_SOURCE_DIR}/txn-ro.c"
851841
"${MDBX_SOURCE_DIR}/txn.c"
852842
"${MDBX_SOURCE_DIR}/unaligned.h"
853843
"${MDBX_SOURCE_DIR}/utils.c"

libmdbx/ChangeLog.md

Lines changed: 1170 additions & 273 deletions
Large diffs are not rendered by default.

libmdbx/README.md

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
<!-- Required extensions: pymdownx.betterem, pymdownx.tilde, pymdownx.emoji, pymdownx.tasklist, pymdownx.superfences -->
22

3+
> Please refer to the online [official libmdbx documentation site](https://libmdbx.dqdkfa.ru)
4+
> with [`C` API description](https://libmdbx.dqdkfa.ru/group__c__api.html)
5+
> and pay attention to the [`C++` API](https://gitflic.ru/project/erthink/libmdbx/blob?file=mdbx.h%2B%2B#line-num-1).
6+
7+
> Questions, feedback and suggestions are welcome to the [Telegram' group](https://t.me/libmdbx) (archive [1](https://libmdbx.dqdkfa.ru/tg-archive/messages1.html),
8+
> [2](https://libmdbx.dqdkfa.ru/tg-archive/messages2.html), [3](https://libmdbx.dqdkfa.ru/tg-archive/messages3.html), [4](https://libmdbx.dqdkfa.ru/tg-archive/messages4.html),
9+
> [5](https://libmdbx.dqdkfa.ru/tg-archive/messages5.html), [6](https://libmdbx.dqdkfa.ru/tg-archive/messages6.html), [7](https://libmdbx.dqdkfa.ru/tg-archive/messages7.html)).
10+
> See the [ChangeLog](https://gitflic.ru/project/erthink/libmdbx/blob?file=ChangeLog.md) for `NEWS` and latest updates.
11+
12+
> Donations are welcome to the Ethereum/ERC-20 `0xD104d8f8B2dC312aaD74899F83EBf3EEBDC1EA3A`.
13+
> Всё будет хорошо!
14+
315
libmdbx
416
========
517

@@ -26,44 +38,32 @@ tree](https://en.wikipedia.org/wiki/B%2B_tree).
2638
[WAL](https://en.wikipedia.org/wiki/Write-ahead_logging), but that might
2739
be a caveat for write-intensive workloads with durability requirements.
2840

29-
4. Enforces [serializability](https://en.wikipedia.org/wiki/Serializability) for
41+
4. **Compact and friendly for fully embedding**. Only ≈25KLOC of `C11`,
42+
≈64K x86 binary code of core, no internal threads neither server process(es),
43+
but implements a simplified variant of the [Berkeley
44+
DB](https://en.wikipedia.org/wiki/Berkeley_DB) and
45+
[dbm](https://en.wikipedia.org/wiki/DBM_(computing)) API.
46+
47+
5. Enforces [serializability](https://en.wikipedia.org/wiki/Serializability) for
3048
writers just by single
3149
[mutex](https://en.wikipedia.org/wiki/Mutual_exclusion) and affords
3250
[wait-free](https://en.wikipedia.org/wiki/Non-blocking_algorithm#Wait-freedom)
3351
for parallel readers without atomic/interlocked operations, while
3452
**writing and reading transactions do not block each other**.
3553

36-
5. **Guarantee data integrity** after crash unless this was explicitly
54+
6. **Guarantee data integrity** after crash unless this was explicitly
3755
neglected in favour of write performance.
3856

39-
6. Supports Linux, Windows, MacOS, Android, iOS, FreeBSD, DragonFly, Solaris,
57+
7. Supports Linux, Windows, MacOS, Android, iOS, FreeBSD, DragonFly, Solaris,
4058
OpenSolaris, OpenIndiana, NetBSD, OpenBSD and other systems compliant with
4159
**POSIX.1-2008**.
4260

43-
7. **Compact and friendly for fully embedding**. Only ≈25KLOC of `C11`,
44-
≈64K x86 binary code of core, no internal threads neither server process(es),
45-
but implements a simplified variant of the [Berkeley
46-
DB](https://en.wikipedia.org/wiki/Berkeley_DB) and
47-
[dbm](https://en.wikipedia.org/wiki/DBM_(computing)) API.
48-
4961
<!-- section-end -->
5062

51-
Historically, _libmdbx_ is a deeply revised and extended descendant of the legendary
63+
Historically, _libmdbx_ is a deeply revised and extended descendant of the amazing
5264
[Lightning Memory-Mapped Database](https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database).
5365
_libmdbx_ inherits all benefits from _LMDB_, but resolves some issues and adds [a set of improvements](#improvements-beyond-lmdb).
5466

55-
[![Telergam: Support | Discussions | News](https://img.shields.io/endpoint?color=scarlet&logo=telegram&label=Support%20%7C%20Discussions%20%7C%20News&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Flibmdbx)](https://t.me/libmdbx)
56-
57-
> Please refer to the online [documentation](https://libmdbx.dqdkfa.ru)
58-
> with [`C` API description](https://libmdbx.dqdkfa.ru/group__c__api.html)
59-
> and pay attention to the [`C++` API](https://gitflic.ru/project/erthink/libmdbx/blob?file=mdbx.h%2B%2B#line-num-1).
60-
> Donations are welcome to the Ethereum/ERC-20 `0xD104d8f8B2dC312aaD74899F83EBf3EEBDC1EA3A`.
61-
> Всё будет хорошо!
62-
63-
Telegram Group archive: [1](https://libmdbx.dqdkfa.ru/tg-archive/messages1.html),
64-
[2](https://libmdbx.dqdkfa.ru/tg-archive/messages2.html), [3](https://libmdbx.dqdkfa.ru/tg-archive/messages3.html), [4](https://libmdbx.dqdkfa.ru/tg-archive/messages4.html),
65-
[5](https://libmdbx.dqdkfa.ru/tg-archive/messages5.html), [6](https://libmdbx.dqdkfa.ru/tg-archive/messages6.html), [7](https://libmdbx.dqdkfa.ru/tg-archive/messages7.html).
66-
6767
## Github
6868

6969
### на Русском (мой родной язык)
@@ -125,7 +125,8 @@ of the database. All fundamental architectural problems of libmdbx/LMDB
125125
have been solved there, but now the active development has been
126126
suspended for top-three reasons:
127127

128-
1. For now _libmdbx_ mostly enough and I’m busy for scalability.
128+
1. For now _libmdbx_ «mostly» enough for all [our products](https://www.ptsecurity.com/ww-en/products/),
129+
and I’m busy in development of replication for scalability.
129130
2. Waiting for fresh [Elbrus CPU](https://wiki.elbrus.ru/) of [e2k architecture](https://en.wikipedia.org/wiki/Elbrus_2000),
130131
especially with hardware acceleration of [Streebog](https://en.wikipedia.org/wiki/Streebog) and
131132
[Kuznyechik](https://en.wikipedia.org/wiki/Kuznyechik), which are required for Merkle tree, etc.
@@ -550,9 +551,9 @@ Of course, in addition to this, your toolchain must ensure the reproducibility o
550551
For more information please refer to [reproducible-builds.org](https://reproducible-builds.org/).
551552

552553
#### Containers
553-
There are no special traits nor quirks if you use _libmdbx_ ONLY inside
554-
the single container. But in a cross-container(s) or with a host-container(s)
555-
interoperability cases the three major things MUST be guaranteed:
554+
There are no special traits nor quirks if you use libmdbx ONLY inside the single container.
555+
But in a cross-container cases or with a host-container(s) mix the two major things MUST be
556+
guaranteed:
556557

557558
1. Coherence of memory mapping content and unified page cache inside OS
558559
kernel for host and all container(s) operated with a DB. Basically this
@@ -568,12 +569,6 @@ in the system memory.
568569
including `ERROR_ACCESS_DENIED`,
569570
but not the `ERROR_INVALID_PARAMETER` as for an invalid/non-existent PID.
570571

571-
3. The versions/builds of _libmdbx_ and `libc`/`pthreads` (`glibc`, `musl`, etc) must be be compatible.
572-
- Basically, the `options:` string in the output of `mdbx_chk -V` must be the same for host and container(s).
573-
See `MDBX_LOCKING`, `MDBX_USE_OFDLOCKS` and other build options for details.
574-
- Avoid using different versions of `libc`, especially mixing different implementations, i.e. `glibc` with `musl`, etc.
575-
Prefer to use the same LTS version, or switch to full virtualization/isolation if in doubt.
576-
577572
#### DSO/DLL unloading and destructors of Thread-Local-Storage objects
578573
When building _libmdbx_ as a shared library or use static _libmdbx_ as a
579574
part of another dynamic library, it is advisable to make sure that your

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-0-ga13147d1", "git_timestamp": "2025-05-06T14:15:36+03:00", "git_tree": "1c8f0e50d4b62e8e5a881a86b049d6a3e17a3edd", "git_commit": "a13147d115ff87e76046d019af5a60b42f4ad323", "semver": "0.14.1" }
1+
{ "git_describe": "v0.13.9-0-g926e90ac", "git_timestamp": "2025-10-31T12:33:51+03:00", "git_tree": "dca663bdf7f9f8830ac0d46059c44089d56cf521", "git_commit": "926e90ac9a13eb761afc85d37641e4acfa8ea998", "semver": "0.13.9" }

libmdbx/config.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@
6363

6464
#cmakedefine01 MDBX_USE_MINCORE
6565

66+
#cmakedefine MDBX_USE_FALLOCATE_AUTO
67+
#ifndef MDBX_USE_FALLOCATE_AUTO
68+
#cmakedefine01 MDBX_USE_FALLOCATE
69+
#endif /* MDBX_USE_FALLOCATE */
70+
6671
/* Build Info */
6772
#ifndef MDBX_BUILD_TIMESTAMP
6873
#cmakedefine MDBX_BUILD_TIMESTAMP "@MDBX_BUILD_TIMESTAMP@"

libmdbx/man1/mdbx_chk.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
22
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
3-
.TH MDBX_CHK 1 "2025-01-14" "MDBX 0.14"
3+
.TH MDBX_CHK 1 "2024-08-29" "MDBX 0.13"
44
.SH NAME
55
mdbx_chk \- MDBX checking tool
66
.SH SYNOPSIS

libmdbx/man1/mdbx_copy.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
33
.\" Copyright 2012-2015 Howard Chu, Symas Corp. All Rights Reserved.
44
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5-
.TH MDBX_COPY 1 "2025-01-14" "MDBX 0.14"
5+
.TH MDBX_COPY 1 "2024-08-29" "MDBX 0.13"
66
.SH NAME
77
mdbx_copy \- MDBX environment copy tool
88
.SH SYNOPSIS

libmdbx/man1/mdbx_drop.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" Copyright 2021-2025 Leonid Yuriev <leo@yuriev.ru>.
22
.\" Copyright 2014-2021 Howard Chu, Symas Corp. All Rights Reserved.
33
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
4-
.TH MDBX_DROP 1 "2025-01-14" "MDBX 0.14"
4+
.TH MDBX_DROP 1 "2024-08-29" "MDBX 0.13"
55
.SH NAME
66
mdbx_drop \- MDBX database delete tool
77
.SH SYNOPSIS

libmdbx/man1/mdbx_dump.1

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
33
.\" Copyright 2014-2015 Howard Chu, Symas Corp. All Rights Reserved.
44
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5-
.TH MDBX_DUMP 1 "2025-01-14" "MDBX 0.14"
5+
.TH MDBX_DUMP 1 "2024-08-29" "MDBX 0.13"
66
.SH NAME
77
mdbx_dump \- MDBX environment export tool
88
.SH SYNOPSIS
@@ -12,8 +12,6 @@ mdbx_dump \- MDBX environment export tool
1212
[\c
1313
.BR \-q ]
1414
[\c
15-
.BR \-c ]
16-
[\c
1715
.BI \-f \ file\fR]
1816
[\c
1917
.BR \-l ]
@@ -43,9 +41,6 @@ Write the library version number to the standard output, and exit.
4341
.BR \-q
4442
Be quiet.
4543
.TP
46-
.BR \-c
47-
Concise mode without repeating keys in a dump, but incompatible with Berkeley DB and LMDB.
48-
.TP
4944
.BR \-f \ file
5045
Write to the specified file instead of to the standard output.
5146
.TP

libmdbx/man1/mdbx_load.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
33
.\" Copyright 2014-2015 Howard Chu, Symas Corp. All Rights Reserved.
44
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5-
.TH MDBX_LOAD 1 "2025-01-14" "MDBX 0.14"
5+
.TH MDBX_LOAD 1 "2024-08-29" "MDBX 0.13"
66
.SH NAME
77
mdbx_load \- MDBX environment import tool
88
.SH SYNOPSIS

0 commit comments

Comments
 (0)