From 013303fde35bc62a02c6b7c305b506019850098e Mon Sep 17 00:00:00 2001 From: colobrodo Date: Tue, 27 Oct 2026 09:54:36 +0100 Subject: [PATCH 1/2] Changed the getrusage conversion from KB to KiB --- include/essentials.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/essentials.hpp b/include/essentials.hpp index b302fc9..f026d8b 100644 --- a/include/essentials.hpp +++ b/include/essentials.hpp @@ -47,7 +47,9 @@ static const uint64_t KiB = uint64_t(1) << 10; template struct is_pod { #if __cplusplus >= 202002L - static constexpr bool value = std::is_trivially_copyable::value && std::is_trivially_default_constructible::value && std::is_standard_layout::value; + static constexpr bool value = std::is_trivially_copyable::value && + std::is_trivially_default_constructible::value && + std::is_standard_layout::value; #else static constexpr bool value = std::is_pod::value; #endif @@ -94,11 +96,11 @@ static inline void do_not_optimize_away(T&& value) { [[maybe_unused]] static uint64_t maxrss_in_bytes() { struct rusage ru; if (getrusage(RUSAGE_SELF, &ru) == 0) { - // NOTE: ru_maxrss is in kilobytes on Linux, but not on Apple... + // NOTE: ru_maxrss is in kibibytes on Linux, but not on Apple... #ifdef __APPLE__ return ru.ru_maxrss; #endif - return ru.ru_maxrss * 1000; + return ru.ru_maxrss * 1024; } return 0; } From 7243fef808d67fff5ad6b5819217e152d0d3c831 Mon Sep 17 00:00:00 2001 From: colobrodo Date: Tue, 27 Oct 2026 09:56:39 +0100 Subject: [PATCH 2/2] Removed automatic indentation of the formatter I have committed inadvertently --- include/essentials.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/essentials.hpp b/include/essentials.hpp index f026d8b..2d859fb 100644 --- a/include/essentials.hpp +++ b/include/essentials.hpp @@ -47,9 +47,7 @@ static const uint64_t KiB = uint64_t(1) << 10; template struct is_pod { #if __cplusplus >= 202002L - static constexpr bool value = std::is_trivially_copyable::value && - std::is_trivially_default_constructible::value && - std::is_standard_layout::value; + static constexpr bool value = std::is_trivially_copyable::value && std::is_trivially_default_constructible::value && std::is_standard_layout::value; #else static constexpr bool value = std::is_pod::value; #endif