diff --git a/libraries/liblmdb/CHANGES b/libraries/liblmdb/CHANGES index 2b81d4afbb..68c1637279 100644 --- a/libraries/liblmdb/CHANGES +++ b/libraries/liblmdb/CHANGES @@ -1,5 +1,10 @@ LMDB 0.9 Change Log +LMDB 0.9.30 Release (2022/10/19) + ITS#9919 - Mark infrequently used functions as cold + ITS#9723 - clear C_EOF on cursor with MDB_FIRST_DUP + ITS#9030 - Use sys/cachectl.h rather than asm/cachectl.h on mips + LMDB 0.9.29 Release (2021/03/16) ITS#9461 refix ITS#9376 ITS#9500 fix regression from ITS#8662 diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 69aa2751a2..30491cd04f 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -200,7 +200,7 @@ typedef int mdb_filehandle_t; /** Library minor version */ #define MDB_VERSION_MINOR 9 /** Library patch version */ -#define MDB_VERSION_PATCH 29 +#define MDB_VERSION_PATCH 30 /** Combine args a,b,c into a single integer for easy version comparisons */ #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) @@ -210,7 +210,7 @@ typedef int mdb_filehandle_t; MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH) /** The release date of this library version */ -#define MDB_VERSION_DATE "March 16, 2021" +#define MDB_VERSION_DATE "October 19, 2021" /** A stringifier for the version info */ #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 8cecdb2e69..b64e3a60d6 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -77,8 +77,7 @@ #if defined(__mips) && defined(__linux) /* MIPS has cache coherency issues, requires explicit cache control */ -#include -extern int cacheflush(char *addr, int nbytes, int cache); +#include #define CACHEFLUSH(addr, bytes, cache) cacheflush(addr, bytes, cache) #else #define CACHEFLUSH(addr, bytes, cache) @@ -200,15 +199,21 @@ typedef SSIZE_T ssize_t; # error "Two's complement, reasonably sized integer types, please" #endif -#ifdef __GNUC__ -/** Put infrequently used env functions in separate section */ -# ifdef __APPLE__ -# define ESECT __attribute__ ((section("__TEXT,text_env"))) -# else -# define ESECT __attribute__ ((section("text_env"))) -# endif +#if (((__clang_major__ << 8) | __clang_minor__) >= 0x0302) || (((__GNUC__ << 8) | __GNUC_MINOR__) >= 0x0403) +/** Mark infrequently used env functions as cold. This puts them in a separate + * section, and optimizes them for size */ +#define ESECT __attribute__ ((cold)) #else -#define ESECT +/* On older compilers, use a separate section */ +# ifdef __GNUC__ +# ifdef __APPLE__ +# define ESECT __attribute__ ((section("__TEXT,text_env"))) +# else +# define ESECT __attribute__ ((section("text_env"))) +# endif +# else +# define ESECT +# endif #endif #ifdef _WIN32 @@ -1517,6 +1522,8 @@ mdb_strerror(int err) NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE); return ptr; #else + if (err < 0) + return "Invalid error code"; return strerror(err); #endif } @@ -6477,6 +6484,7 @@ fetchm: rc = MDB_NOTFOUND; break; } + mc->mc_flags &= ~C_EOF; { MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) { diff --git a/libraries/liblmdb/mdb_dump.c b/libraries/liblmdb/mdb_dump.c index 671ec574d0..7ea72e8a9a 100644 --- a/libraries/liblmdb/mdb_dump.c +++ b/libraries/liblmdb/mdb_dump.c @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) break; case 'l': list = 1; - /*FALLTHROUGH*/; + /*FALLTHROUGH*/ case 'a': if (subname) usage(prog);