From c5924c2288c4c116ae4cecb93643fcacae8f28cf Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Fri, 23 Aug 2024 16:37:30 +0200 Subject: [PATCH] Core: Fixed sizeof(String) with MSBT --- benchmarks/sizeof/main.cpp | 1 + uppsrc/Core/String.h | 2 +- uppsrc/Core/Topt.h | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmarks/sizeof/main.cpp b/benchmarks/sizeof/main.cpp index fad1bf0ad..611ca54f0 100644 --- a/benchmarks/sizeof/main.cpp +++ b/benchmarks/sizeof/main.cpp @@ -62,6 +62,7 @@ CONSOLE_APP_MAIN RDUMP(sizeof(Pointf)); RDUMP(sizeof(Rectf)); RDUMP(sizeof(Color)); + RDUMP(sizeof(RGBA)); RDUMP(sizeof(Complex)); RDUMP(sizeof(Uuid)); RDUMP(sizeof(Mutex)); diff --git a/uppsrc/Core/String.h b/uppsrc/Core/String.h index 01cfd4586..c98a1f49a 100644 --- a/uppsrc/Core/String.h +++ b/uppsrc/Core/String.h @@ -166,7 +166,7 @@ public: friend String operator+(tchar a, const String& b) { String c(a, 1); c += b; return c; } }; -class String0 : Moveable { +class String0 { enum { // KIND = 14, // chr[KIND] is String tier flag, 0 - small, 31 - medium, 32..254 ref alloc, 255 - read alloc from Ref SLEN = 15, // chr[SLEN] stores the length of small tier strings (up to 14 bytes) diff --git a/uppsrc/Core/Topt.h b/uppsrc/Core/Topt.h index 8339b5e4f..39160b250 100644 --- a/uppsrc/Core/Topt.h +++ b/uppsrc/Core/Topt.h @@ -158,11 +158,11 @@ inline void Destroy(T *t, const T *end) template struct TriviallyRelocatable {}; -template +template struct Moveable : TriviallyRelocatable {}; template // backward compatiblity -struct Moveable_ : Moveable {}; +struct Moveable_ {}; template inline constexpr bool is_trivially_relocatable = std::is_trivially_copyable_v ||