rose: move sparse iter cache to RoseEngineBlob

This enables its use for iterators written by instructions.
This commit is contained in:
Justin Viiret
2016-08-24 10:16:12 +10:00
committed by Matthew Barr
parent 13b6023a18
commit 9139123642
4 changed files with 33 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,16 +34,18 @@
#define MULTIBIT_BUILD_H
#include "multibit_internal.h"
#include "hash.h"
#include <vector>
/** \brief Comparator for \ref mmbit_sparse_iter structures. */
static inline
bool operator<(const mmbit_sparse_iter &a, const mmbit_sparse_iter &b) {
if (a.mask != b.mask) {
return a.mask < b.mask;
}
return a.val < b.val;
inline
bool operator==(const mmbit_sparse_iter &a, const mmbit_sparse_iter &b) {
return a.mask == b.mask && a.val == b.val;
}
inline
size_t hash_value(const mmbit_sparse_iter &iter) {
return ue2::hash_all(iter.mask, iter.val);
}
namespace ue2 {