diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-16 19:14:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-16 19:21:45 +0200 |
commit | c13da77e8509cdd3e71af049d105fa15de32fd72 (patch) | |
tree | 464b2fd4ede5717847ca27c3d0cbdfe5ab6c8dd1 /DevTools/UserspaceEmulator/SoftMMU.h | |
parent | 1dcc21d32eaaefc2764b2897274f73724fae2ba9 (diff) | |
download | serenity-c13da77e8509cdd3e71af049d105fa15de32fd72.zip |
UserspaceEmulator: Add TLS regions to reachability checking
Diffstat (limited to 'DevTools/UserspaceEmulator/SoftMMU.h')
-rw-r--r-- | DevTools/UserspaceEmulator/SoftMMU.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/DevTools/UserspaceEmulator/SoftMMU.h b/DevTools/UserspaceEmulator/SoftMMU.h index a79e939fea..d73eff7165 100644 --- a/DevTools/UserspaceEmulator/SoftMMU.h +++ b/DevTools/UserspaceEmulator/SoftMMU.h @@ -98,7 +98,18 @@ public: SharedBufferRegion* shbuf_region(int shbuf_id); - NonnullOwnPtrVector<Region>& regions() { return m_regions; } + template<typename Callback> + void for_each_region(Callback callback) + { + if (m_tls_region) { + if (callback(*m_tls_region) == IterationDecision::Break) + return; + } + for (auto& region : m_regions) { + if (callback(region) == IterationDecision::Break) + return; + } + } private: OwnPtr<Region> m_tls_region; |