-/* Copyright (c) 2008-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2008-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/mc/mc_config.hpp"
#include "src/mc/mc_private.hpp"
-#include "src/mc/mc_smx.hpp"
#include "src/mc/sosp/Snapshot.hpp"
#include <algorithm>
static bool is_stack(const void *address)
{
- for (auto const& stack : mc_model_checker->get_remote_simulation().stack_areas())
- if (address == stack.address)
- return true;
- return false;
+ auto const& stack_areas = mc_model_checker->get_remote_simulation().stack_areas();
+ return std::any_of(stack_areas.begin(), stack_areas.end(),
+ [address](auto const& stack) { return stack.address == address; });
}
// TODO, this should depend on the snapshot?
static bool is_block_stack(int block)
{
- for (auto const& stack : mc_model_checker->get_remote_simulation().stack_areas())
- if (block == stack.block)
- return true;
- return false;
+ auto const& stack_areas = mc_model_checker->get_remote_simulation().stack_areas();
+ return std::any_of(stack_areas.begin(), stack_areas.end(),
+ [block](auto const& stack) { return stack.block == block; });
}
namespace simgrid {