diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 5a1209b85..5040941aa 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -5165,7 +5165,9 @@ void Td::on_request(uint64 id, td_api::optimizeStorage &request) { animations_manager_->memory_cleanup(); file_manager_->memory_cleanup(); - malloc_trim(0); + #ifdef __linux__ + malloc_trim(0); + #endif std::vector file_types; for (auto &file_type : request.file_types_) {