mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-07 03:40:07 +00:00
Fix linux
This commit is contained in:
parent
35ec4de776
commit
56540a55ec
@ -10,9 +10,11 @@ namespace rsx
|
|||||||
template<typename T, int BlockSize>
|
template<typename T, int BlockSize>
|
||||||
class ranged_map
|
class ranged_map
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
using inner_type = typename std::unordered_map<u32, T>;
|
using inner_type = typename std::unordered_map<u32, T>;
|
||||||
using outer_type = typename std::array<inner_type, 0x100000000ull / BlockSize>;
|
using outer_type = typename std::array<inner_type, 0x100000000ull / BlockSize>;
|
||||||
|
|
||||||
|
protected:
|
||||||
outer_type m_data;
|
outer_type m_data;
|
||||||
|
|
||||||
static inline u32 block_for(u32 address)
|
static inline u32 block_for(u32 address)
|
||||||
@ -23,15 +25,16 @@ namespace rsx
|
|||||||
public:
|
public:
|
||||||
class iterator
|
class iterator
|
||||||
{
|
{
|
||||||
using super = typename ranged_map<T, BlockSize>;
|
using super = typename rsx::ranged_map<T, BlockSize>;
|
||||||
friend class super;
|
using inner_iterator = typename inner_type::iterator;
|
||||||
|
friend super;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inner_type* m_current = nullptr;
|
inner_type* m_current = nullptr;
|
||||||
inner_type* m_end = nullptr;
|
inner_type* m_end = nullptr;
|
||||||
|
|
||||||
outer_type* m_data_ptr = nullptr;
|
outer_type* m_data_ptr = nullptr;
|
||||||
inner_type::iterator m_it{};
|
inner_iterator m_it{};
|
||||||
|
|
||||||
inline void forward_scan()
|
inline void forward_scan()
|
||||||
{
|
{
|
||||||
@ -64,14 +67,14 @@ namespace rsx
|
|||||||
forward_scan();
|
forward_scan();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void begin_range(const utils::address_range& range, inner_type::iterator& where)
|
inline void begin_range(const utils::address_range& range, inner_iterator& where)
|
||||||
{
|
{
|
||||||
m_it = where;
|
m_it = where;
|
||||||
m_current = &(*m_data_ptr)[range.start / BlockSize];
|
m_current = &(*m_data_ptr)[range.start / BlockSize];
|
||||||
m_end = &(*m_data_ptr)[(range.end + 1) / BlockSize];
|
m_end = &(*m_data_ptr)[(range.end + 1) / BlockSize];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void begin_range(u32 address, inner_type::iterator& where)
|
inline void begin_range(u32 address, inner_iterator& where)
|
||||||
{
|
{
|
||||||
begin_range(utils::address_range::start_length(address, 1), where);
|
begin_range(utils::address_range::start_length(address, 1), where);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user