From 03381fa4696b12afd2b679c14de9de18e891b4b7 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 21 Jan 2022 14:19:08 +0300 Subject: [PATCH] mdbx++: clarify comments for `mdbx::byte` and `char8_t` usage. Related to https://github.com/erthink/libmdbx/issues/263. --- mdbx.h++ | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index db85ffb6..cd35e8f3 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -251,11 +251,15 @@ namespace mdbx { // Functions whose signature depends on the `mdbx::byte` type // must be strictly defined as inline! #if defined(DOXYGEN) || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811) -// Wanna using a non-aliasing type to release more power of an optimizer. +// To enable all kinds of an compiler optimizations we use a byte-like type +// that don't presumes aliases for pointers as does the `char` type and its +// derivatives/typedefs. +// Please see https://github.com/erthink/libmdbx/issues/263 +// for reasoning of the use of `char8_t` type and switching to `__restrict__`. using byte = char8_t; #else -// Wanna not using std::byte since it doesn't add features, -// but add inconvenient restrictions. +// Avoid `std::byte` since it doesn't add features but inconvenient +// restrictions. using byte = unsigned char; #endif /* __cpp_char8_t >= 201811*/