diff --git a/modules/console.cc b/modules/console.cc index fe4d8cac6..13a3c8b2b 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -602,6 +602,31 @@ console_cmd__mem(opt &out, const string_view &line) return true; } +bool +console_cmd__mem__trim(opt &out, const string_view &line) +{ + const params param{line, " ", + { + "pad" + }}; + + const size_t &pad + { + param.at("pad", 0UL) + }; + + const auto ret + { + ircd::allocator::trim(pad) + }; + + out << "malloc trim " + << (ret? "was able to release some memory." : "did not release any memory.") + << std::endl; + + return true; +} + // // env //