From cba3378732049a943e044039bde3aab1707ccca1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 22 Jun 2016 22:00:08 -0700 Subject: Make QDateTime's default constructor not allocate memory on 32-bit Commit fb498a651990df5e04c75a9076da28e875c43f73 introduced the short datetime optimization, but it accidentally removed the optimization from Qt 5.7 that made QDateTime's default constructor not allocate memory. Instead of bringing back the Q_GLOBAL_STATIC that was used, let's use the short date time optimization on 32-bit too. The CanBeSmall constant remains false on 32-bit systems, but judicious non-use of that constant in a few functions allows 32-bit systems to use the optimization. We still say that any date/time value is "unsmall", as there's no sense in calculating whether the date is between 1970-01-01 and July 14 of the same year. Change-Id: I413d458307aa46469b80fffd145a9db0325c08cc Reviewed-by: Edward Welbourne --- src/corelib/tools/qdatetime.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/tools/qdatetime.h') diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 7111509bcc..ec0eaa1edf 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -230,6 +230,7 @@ class Q_CORE_EXPORT QDateTime CanBeSmall = sizeof(ShortData) * 8 > 50 }; + Data(); Data(Qt::TimeSpec); Data(const Data &other); Data(Data &&other); -- cgit v1.2.3