mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02: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;
|
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
|
// env
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue