Commit a0b28ba3 authored by Mishigan's avatar Mishigan Committed by Julien Balette-Pape

passage aux pointeurs d'adresse

parent 1be6a9ed
......@@ -7,18 +7,23 @@
namespace lrusecurity
{
class ACSSecurity : public elm::AllocArray<std::set <otawa::Address *>>
struct Ptr_addr_comparator
{
bool operator()(const otawa::Address* a, const otawa::Address*b ) const {return *a < *b;}
};
class ACSSecurity : public elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>
{
public:
ACSSecurity() = default;
ACSSecurity(int n) : elm::AllocArray<std::set <otawa::Address *>>(n){
ACSSecurity(int n) : elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>(n){
for (int i = 0; i < n; i++)
(*this)[i] = std::set <otawa::Address *>();
(*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>();
}
ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::set <otawa::Address *>>(n) {
ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>(n) {
for (int i = 0; i < n; i++)
(*this)[i] = std::set <otawa::Address *>({&addr});
(*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>({&addr});
}
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment