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:
parent
f023d05e66
commit
960ffe1f16
1 changed files with 25 additions and 0 deletions
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue