From 1cd126d728d53e32c5fa59b43b5344999f87ef52 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 28 Sep 2017 14:40:10 +0300 Subject: [PATCH] Disable not type-erased consumers on GCC. --- Telegram/SourceFiles/rpl/consumer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/rpl/consumer.h b/Telegram/SourceFiles/rpl/consumer.h index e34ef678be..b4791280ee 100644 --- a/Telegram/SourceFiles/rpl/consumer.h +++ b/Telegram/SourceFiles/rpl/consumer.h @@ -621,6 +621,9 @@ inline bool operator>=( return !(a < b); } +// GCC 7.2 can't handle not type-erased consumers. +// It eats up 4GB RAM + 16GB swap on the unittest and dies. +// Clang and Visual C++ both handle it without such problems. template < typename Value, typename Error, @@ -631,7 +634,11 @@ template < details::is_callable_v && details::is_callable_v && details::is_callable_v>> +#ifdef COMPILER_GCC +inline consumer make_consumer( +#else // COMPILER_GCC inline auto make_consumer( +#endif // COMPILER_GCC OnNext &&next, OnError &&error, OnDone &&done) {