diff options
Diffstat (limited to 'runtime/src/buffer_va_index.h')
| -rw-r--r-- | runtime/src/buffer_va_index.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/src/buffer_va_index.h b/runtime/src/buffer_va_index.h index 6fbba5b05..3ab8edf82 100644 --- a/runtime/src/buffer_va_index.h +++ b/runtime/src/buffer_va_index.h | |||
| @@ -91,6 +91,11 @@ public: | |||
| 91 | 91 | ||
| 92 | std::size_t size() const { return ranges_.size(); } | 92 | std::size_t size() const { return ranges_.size(); } |
| 93 | std::uint64_t longest() const { return longest_; } | 93 | std::uint64_t longest() const { return longest_; } |
| 94 | // f(first VA, bytes) for every range, in VA order. | ||
| 95 | template <class F> | ||
| 96 | void for_each(F&& f) const { | ||
| 97 | for (const auto& [key, bytes] : ranges_) f(key.first, bytes); | ||
| 98 | } | ||
| 94 | 99 | ||
| 95 | private: | 100 | private: |
| 96 | static constexpr Id max_id() { return ~Id(0); } | 101 | static constexpr Id max_id() { return ~Id(0); } |