0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

modules/console: Add mem trim cmd.

This commit is contained in:
Jason Volk 2018-09-27 16:27:16 -07:00
parent f023d05e66
commit 960ffe1f16

View file

@ -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<size_t>("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
//