vm_native.cpp: Use Windows 10 memory mapping API (the correct API)
This commit is contained in:
+13
-1
@@ -3,7 +3,7 @@
|
||||
#include "util/types.hpp"
|
||||
#include "util/atomic.hpp"
|
||||
|
||||
//! Simple sizeless array base for concurrent access. Cannot shrink, only growths automatically.
|
||||
//! Simple unshrinkable array base for concurrent access. Only growths automatically.
|
||||
//! There is no way to know the current size. The smaller index is, the faster it's accessed.
|
||||
//!
|
||||
//! T is the type of elements. Currently, default constructor of T shall be constexpr.
|
||||
@@ -47,6 +47,18 @@ public:
|
||||
// Access recursively
|
||||
return (*m_next)[index - N];
|
||||
}
|
||||
|
||||
u64 size() const
|
||||
{
|
||||
u64 size_n = 0;
|
||||
|
||||
for (auto ptr = this; ptr; ptr = ptr->m_next)
|
||||
{
|
||||
size_n += N;
|
||||
}
|
||||
|
||||
return size_n;
|
||||
}
|
||||
};
|
||||
|
||||
//! Simple lock-free FIFO queue base. Based on lf_array<T, N> itself. Currently uses 32-bit counters.
|
||||
|
||||
Reference in New Issue
Block a user