forked from suyu/suyu
memory_manager: Explicitly specifcy std::min<size_t>
This commit is contained in:
parent
4f09f0aea4
commit
b19fe55f84
1 changed files with 2 additions and 2 deletions
|
@ -104,7 +104,7 @@ ResultCode MemoryManager::Allocate(PageLinkedList& page_list, std::size_t num_pa
|
||||||
// Ensure that we don't leave anything un-freed
|
// Ensure that we don't leave anything un-freed
|
||||||
auto group_guard = detail::ScopeExit([&] {
|
auto group_guard = detail::ScopeExit([&] {
|
||||||
for (const auto& it : page_list.Nodes()) {
|
for (const auto& it : page_list.Nodes()) {
|
||||||
const auto min_num_pages{std::min(
|
const auto min_num_pages{std::min<size_t>(
|
||||||
it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)};
|
it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)};
|
||||||
chosen_manager.Free(it.GetAddress(), min_num_pages);
|
chosen_manager.Free(it.GetAddress(), min_num_pages);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ ResultCode MemoryManager::Free(PageLinkedList& page_list, std::size_t num_pages,
|
||||||
|
|
||||||
// Free all of the pages
|
// Free all of the pages
|
||||||
for (const auto& it : page_list.Nodes()) {
|
for (const auto& it : page_list.Nodes()) {
|
||||||
const auto min_num_pages{std::min(
|
const auto min_num_pages{std::min<size_t>(
|
||||||
it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)};
|
it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)};
|
||||||
chosen_manager.Free(it.GetAddress(), min_num_pages);
|
chosen_manager.Free(it.GetAddress(), min_num_pages);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue